summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2020-04-06 10:51:55 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-06 17:30:57 +0000
commit912bce679aeb48503175f3ac1cb0a87f32f0463f (patch)
treebfc13c8e2895350cf248da170ef5549f13a4e670
parentcc2f60792be600cf0bec65731a27cb6f7fcf42b4 (diff)
downloadmongo-912bce679aeb48503175f3ac1cb0a87f32f0463f.tar.gz
SERVER-45910 Ensure all routers see result of movePrimary in change_streams_primary_shard_unaware.js
-rw-r--r--jstests/sharding/change_streams_primary_shard_unaware.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/jstests/sharding/change_streams_primary_shard_unaware.js b/jstests/sharding/change_streams_primary_shard_unaware.js
index b325f770585..ee1cc5f409c 100644
--- a/jstests/sharding/change_streams_primary_shard_unaware.js
+++ b/jstests/sharding/change_streams_primary_shard_unaware.js
@@ -49,6 +49,10 @@ const mongosDB = st.s0.getDB(testName);
assert.commandWorked(mongosDB.adminCommand({enableSharding: mongosDB.getName()}));
st.ensurePrimaryShard(mongosDB.getName(), st.rs0.getURL());
+// Ensure all config server nodes have replicated the movePrimary, so that all routers will see
+// the latest primary shard regardless from which node they load the database entry.
+st.configRS.awaitLastOpCommitted();
+
// Create unsharded collection on primary shard.
const mongosColl = mongosDB[testName];
assert.commandWorked(mongosDB.createCollection(testName));