Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT 2024.1][#13358] YSQL: Fix bug in partitioned table DDL atom…
…icity stress test Summary: This diff adds a new type of DDL atomicity stress test for partitioned table into the existing DDL atomicity stress test suite. These new tests exposed a bug that caused them to be flaky (manifested as test timeout after 10 minutes). The bug happens when the DDL transaction is rolled back. In the DDL transaction verifier state, we have `verifier_state->tables` to represent all the tables involved in this transaction. Once we know that the transaction is aborted, we call `YsqlDdlTxnCompleteCallbackInternal` to process all the tables in verifier_state->tables. Then we set the verifier state to YsqlDdlVerificationState::kDdlPostProcessing to indicate that the transaction is finished. But it is possible that verifier_state->tables does not already have all the tables in the txn. For example, a txn involves three tables t1, t2, t3. After t1 and t2 are added to txn, the txn is aborted due to a conflict. In this case `YsqlDdlTxnCompleteCallbackInternal` is only called on t1 and t2 and the state is set to kDdlPostProcessing before t3 gets added. Later when t3 gets added. We currently returns Status::OK() if the state == kDdlPostProcessing, and t3 will never be processed, leading to test failure due to timeout. The fix is always process all the tables in verifier_state->tables. In the above example we re-process t1 and t2 (they will turn into no-op), and process t3. Jira: DB-2996 Original commit: baf343f / D36862 Test Plan: ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityPartitionedTablesStressTest.BasicTest -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityPartitionedTablesStressTest.TestTxnVerificationFailure -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityPartitionedTablesStressTest.TestFailCatalogWrites -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityPartitionedTablesStressTest.TestFailDdlRollback -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityPartitionedTablesStressTest.TestFailDdlVerification -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityStressTest.BasicTest -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityStressTest.TestTxnVerificationFailure -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityStressTest.TestFailCatalogWrites -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityStressTest.TestFailDdlRollback -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityStressTest.TestFailDdlVerification -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityColocatedStressTest.BasicTest -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityColocatedStressTest.TestTxnVerificationFailure -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityColocatedStressTest.TestFailCatalogWrites -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityColocatedStressTest.TestFailDdlRollback -n 20 --tp 1 ./yb_build.sh debug --sj --cxx-test pg_ddl_atomicity_stress-test --gtest_filter=PgDdlAtomicityColocatedStressTest.TestFailDdlVerification -n 20 --tp 1 Reviewers: hsunder, fizaa Reviewed By: fizaa Subscribers: ybase, yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D36933
- Loading branch information