Commit eeb7dde
committed
[#31029] YSQL: Avoid ExternalMiniCluster master/tserver startup race in initdb
ExternalMiniCluster exhibits the same master/tserver startup race as
MiniYBCluster (see dcd8d1d for the underlying bug). The C++ test
harness needs two pieces of wiring:
* In StartMaster(), set
--TEST_master_min_live_tservers_before_initdb=num_tablet_servers next
to --master_auto_run_initdb so the master waits for tservers before
launching initdb. Mirrors the Java-side wiring in MiniYBCluster.
* In Start(), move the WaitForInitDb() call out of StartMasters() and
to the point right after tservers have been launched. The previous
ordering -- WaitForInitDb() synchronously inside StartMasters() --
would deadlock with the new flag, because tservers are only launched
after StartMasters() returns. ExternalMiniCluster::StartMasters() has
no other callers in the codebase, so this deferral is safe.
This fix unmasks the ASAN LSan leak fix (45086aa) for the
PgObjectLocksTest family in src/yb/yql/pgwrapper/pg_object_locks-test.cc.
Without it, the LibPqTestBase-based tests in that family FAIL during
cluster bootstrap under ASAN, hiding the LSan fix's effect.
Test plan:
* asan-clang21 local, repeated, with --skip-cxx-build --skip-java-build -n N --tp 1:
-> 5/5 PASSED for PgObjectLocksTest.VerifyLockTimeout (ticket #30090).
-> 3/3 PASSED each for the four sibling tests Sergei flagged in #30090:
PgObjectLocksTestMixModeDuringPromotion.TestMixModeDuringPromotion
PgObjectLocksTestMixModeDuringPromotion.TestLocksTakenAfterPromotionWithExistingConnections
PgObjectLocksTestRF1.TestShutdownWithWaiters
PgObjectLocksTestRF1.TestDisableReuseAbortedPlainTxn
Without this change, the three LibPqTestBase-based tests fail during
cluster bootstrap. The two PgMiniTestBase-based RF1 tests pass with
or without this change (in-process MiniCluster does not have the race).
* Production code path is gated behind the TEST flag defaulting to 0,
so no observable change for any non-ExternalMiniCluster caller (and
StartMasters() has no callers outside ExternalMiniCluster::Start()).1 parent 9461ec3 commit eeb7dde
1 file changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
409 | 416 | | |
410 | 417 | | |
411 | 418 | | |
| |||
563 | 570 | | |
564 | 571 | | |
565 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
566 | 583 | | |
567 | 584 | | |
568 | 585 | | |
| |||
1281 | 1298 | | |
1282 | 1299 | | |
1283 | 1300 | | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
1287 | 1305 | | |
1288 | 1306 | | |
1289 | 1307 | | |
| |||
0 commit comments