diff options
author | Silvia Surroca <silvia.surroca@mongodb.com> | 2023-04-11 13:59:48 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-11 14:51:28 +0000 |
commit | b7b9d352b9566fe8b4c66eff66f695932b036f54 (patch) | |
tree | 277acb07e37bf3c95b549ef82023aafe8cc88a16 | |
parent | 165dd277f31608064b97f80c3d3a98b4c07e9ef7 (diff) | |
download | mongo-b7b9d352b9566fe8b4c66eff66f695932b036f54.tar.gz |
SERVER-73877 Wait for shard to have a primary before doing a migration in prepare_transaction_then_migrate.js
-rw-r--r-- | jstests/sharding/prepare_transaction_then_migrate.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/jstests/sharding/prepare_transaction_then_migrate.js b/jstests/sharding/prepare_transaction_then_migrate.js index 5a12a83ed4c..4411b3014c1 100644 --- a/jstests/sharding/prepare_transaction_then_migrate.js +++ b/jstests/sharding/prepare_transaction_then_migrate.js @@ -9,6 +9,7 @@ (function() { "use strict"; load('jstests/libs/chunk_manipulation_util.js'); +load('jstests/replsets/rslib.js'); load('jstests/sharding/libs/create_sharded_collection_util.js'); load('jstests/sharding/libs/sharded_transactions_helpers.js'); @@ -92,6 +93,12 @@ let runTest = function(testMode) { if (testMode == TestMode.kWithStepUp) { st.rs0.stepUp(st.rs0.getSecondary()); + + // Wait for the config server to see the new primary. + // TODO SERVER-74177 Remove this once retry on NotWritablePrimary is implemented. + st.forEachConfigServer((conn) => { + awaitRSClientHosts(conn, st.rs0.getPrimary(), {ok: true, ismaster: true}); + }); } else if (testMode == TestMode.kWithRestart) { TestData.skipCollectionAndIndexValidation = true; st.rs0.restart(st.rs0.getPrimary()); |