Commit 390cce1
committed
[yugabyte#29315] YSQL: Fix TestRollbackToSavepointWithDropCreateTableSameName in TSAN/ASAN
Summary:
The test TestRollbackToSavepointWithDropCreateTableSameName has been quite flaky especially in slower builds such as TSAN and ASAN. This
revision fixes the test.
The issue happens when a table gets deleted as part of rollback to savepoint operation. When we have to drop a table in such scenarios, we don't wait
for the table deletion to finish. Instead, we assume it'll be successful once the table has been marked DELETING. See the call to
`RemoveDdlRollbackToSubTxnState` in the YsqlDdlTxnDropTableHelper function. This is safe to do because the deleted table can only be seen by the
current transaction since it must have been created in the same txn block.
In the test, we trigger the rollback to savepoint operation and immediately check for the deletion of the ysql_ddl_txn_verifier_state from the table.
The verifier state is only deleted at the later stages of the table deletion i.e. after the tablet deletion. As a result, on slower builds, we end up
making the assertion sooner than the deletion completion.
Fixed the test by introducing a wait before we assert for the cleanup of verifier state.
Test Plan:
Jenkins: test regex: .*PgDdlSavepointMiniClusterTest.*
./yb_build.sh tsan --cxx-test pgwrapper_pg_ddl_transaction-test --gtest_filter
bool/PgDdlSavepointMiniClusterTest.TestRollbackToSavepointWithDropCreateTableSameName/0 -n 10
./yb_build.sh tsan --cxx-test pgwrapper_pg_ddl_transaction-test --gtest_filter
bool/PgDdlSavepointMiniClusterTest.TestRollbackToSavepointWithDropCreateTableSameName/1 -n 10
Reviewers: pjain, myang
Reviewed By: myang
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D481951 parent d9cfc51 commit 390cce1
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
312 | 327 | | |
313 | 328 | | |
314 | 329 | | |
| |||
621 | 636 | | |
622 | 637 | | |
623 | 638 | | |
| 639 | + | |
624 | 640 | | |
625 | 641 | | |
626 | 642 | | |
| |||
0 commit comments