diff options
author | Blake Oler <blake.oler@mongodb.com> | 2020-04-06 10:51:55 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-06 17:30:57 +0000 |
commit | 912bce679aeb48503175f3ac1cb0a87f32f0463f (patch) | |
tree | bfc13c8e2895350cf248da170ef5549f13a4e670 | |
parent | cc2f60792be600cf0bec65731a27cb6f7fcf42b4 (diff) | |
download | mongo-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.js | 4 |
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)); |