summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2020-05-15 13:25:40 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-18 13:54:48 +0000
commit3443942471729b06c45d1e0069b8aaa6ee670b45 (patch)
tree7b765e00ecf95edc04f2fc9a9e5c43cf43ceba74
parent912735588386424712a1525da1574a4554bf1787 (diff)
downloadmongo-3443942471729b06c45d1e0069b8aaa6ee670b45.tar.gz
SERVER-48246 Wait for RSM to detect failover in range_deleter_interacts_correctly_with_refine_shard_key.js
-rw-r--r--jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js b/jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js
index efb5387cf24..2d3689c8827 100644
--- a/jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js
+++ b/jstests/sharding/range_deleter_interacts_correctly_with_refine_shard_key.js
@@ -215,6 +215,12 @@ function test(st, description, testBody) {
// Clean up the failpoint on the old primary.
hangBeforeWritingDecisionFailpoint.off();
+ // Wait for relevant nodes to detect the new primary, which may take some time using
+ // the RSM protocols other than streamable.
+ awaitRSClientHosts(st.s, newPrimary, {ok: true, ismaster: true});
+ awaitRSClientHosts(st.rs1.getPrimary(), newPrimary, {ok: true, ismaster: true});
+ awaitRSClientHosts(st.configRS.getPrimary(), newPrimary, {ok: true, ismaster: true});
+
// Refine the collection's shard key while the recovery task is hung.
jsTestLog("Refining the shard key");
assert.commandWorked(st.s.getCollection(ns).createIndex({x: 1, y: 1, z: 1}));
@@ -232,8 +238,6 @@ function test(st, description, testBody) {
});
// Verify we can move the chunk back to the original donor once the orphans are gone.
- awaitRSClientHosts(
- st.rs1.getPrimary(), st.rs0.getPrimary(), {ok: true, ismaster: true});
assert.commandWorked(st.s.adminCommand({
moveChunk: ns,
find: {x: 1, y: 1, z: 1},