diff options
author | Abdul Qadeer <abdul.qadeer@mongodb.com> | 2022-09-21 19:48:54 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-27 20:14:50 +0000 |
commit | a2bde0ebc259bf57218f16baa9f8d2a4cbb789e4 (patch) | |
tree | 9e8e2e3560e0d349f61451ad93904a81de0c5e49 /jstests | |
parent | 15575275d619d27970de98696951b884a49b4005 (diff) | |
download | mongo-a2bde0ebc259bf57218f16baa9f8d2a4cbb789e4.tar.gz |
SERVER-69700 Await secondaries' readiness
(cherry picked from commit 6eaf0ea0d0bf24a0d7cfe97c7de7070b3b1baa7e)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/libs/resharding_test_fixture.js | 9 | ||||
-rw-r--r-- | jstests/sharding/resharding_coordinator_recovers_abort_decision.js | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/jstests/sharding/libs/resharding_test_fixture.js b/jstests/sharding/libs/resharding_test_fixture.js index 330d68892fb..5211fd7ba24 100644 --- a/jstests/sharding/libs/resharding_test_fixture.js +++ b/jstests/sharding/libs/resharding_test_fixture.js @@ -220,8 +220,7 @@ var ReshardingTest = class { ]; } - /** @private */ - _getReplSetForShard(shardName) { + getReplSetForShard(shardName) { const res = this._allReplSetTests().find(shardInfo => shardInfo.shardName === shardName); return res.rs; } @@ -831,7 +830,7 @@ var ReshardingTest = class { stepUpNewPrimaryOnShard(shardName) { jsTestLog(`ReshardingTestFixture stepping up new primary on shard ${shardName}`); - const replSet = this._getReplSetForShard(shardName); + const replSet = this.getReplSetForShard(shardName); let originalPrimary = replSet.getPrimary(); let secondaries = replSet.getSecondaries(); @@ -878,7 +877,7 @@ var ReshardingTest = class { killAndRestartPrimaryOnShard(shardName) { jsTestLog(`ReshardingTestFixture killing and restarting primary on shard ${shardName}`); - const replSet = this._getReplSetForShard(shardName); + const replSet = this.getReplSetForShard(shardName); const originalPrimaryConn = replSet.getPrimary(); const SIGKILL = 9; @@ -891,7 +890,7 @@ var ReshardingTest = class { jsTestLog( `ReshardingTestFixture shutting down and restarting primary on shard ${shardName}`); - const replSet = this._getReplSetForShard(shardName); + const replSet = this.getReplSetForShard(shardName); const originalPrimaryConn = replSet.getPrimary(); const SIGTERM = 15; diff --git a/jstests/sharding/resharding_coordinator_recovers_abort_decision.js b/jstests/sharding/resharding_coordinator_recovers_abort_decision.js index 68675787e0b..ecbe91ee159 100644 --- a/jstests/sharding/resharding_coordinator_recovers_abort_decision.js +++ b/jstests/sharding/resharding_coordinator_recovers_abort_decision.js @@ -112,6 +112,12 @@ reshardingTest.withReshardingInBackground( const idx = reshardCollectionJoinedFailPointsList.findIndex(fp => fp.conn.host === configsvrPrimary.host); reshardCollectionJoinedFailPointsList[idx].wait(); + + // Wait for secondaries to recover and catchup with primary before turning off the + // failpoints as a replication roll back can disconnect the test client. + const configRS = reshardingTest.getReplSetForShard(reshardingTest.configShardName); + configRS.awaitSecondaryNodes(); + configRS.awaitReplication(); reshardCollectionJoinedFailPointsList.forEach(fp => fp.off()); shardsvrAbortReshardCollectionFailpoint.off(); }, |