summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-11-16 10:42:34 -0500
committerTess Avitabile <tess.avitabile@mongodb.com>2016-11-17 17:05:55 -0500
commit0362de220040e40dc1d5ebe627e32b4b4b02fb8d (patch)
treed3ccd5bf3f3860f1a580f5e079daf50768e46465
parente9aea748102be9e5b8aac38d4dadd6dc0eb1e32c (diff)
downloadmongo-0362de220040e40dc1d5ebe627e32b4b4b02fb8d.tar.gz
SERVER-27055 initial_sync_id_index.js should not use w:2 write to check initial sync is complete
-rw-r--r--jstests/repl/initial_sync_id_index.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/jstests/repl/initial_sync_id_index.js b/jstests/repl/initial_sync_id_index.js
index 5871f68f323..0159809ed8a 100644
--- a/jstests/repl/initial_sync_id_index.js
+++ b/jstests/repl/initial_sync_id_index.js
@@ -31,8 +31,15 @@
const slave = rt.start(false);
const slaveDB = slave.getDB("test");
- // Perform a w=2 write to ensure that slave can be read from, and initial sync is complete.
- assert.writeOK(masterDB.coll.insert({}, {writeConcern: {w: 2}}));
+ // Wait for the slave to sync the collections.
+ assert.soon(function() {
+ var res = slaveDB.runCommand({listCollections: 1, filter: {name: "collV2"}});
+ return res.cursor.firstBatch.length === 1;
+ }, "Collection with v:2 _id index failed to sync on slave");
+ assert.soon(function() {
+ var res = slaveDB.runCommand({listCollections: 1, filter: {name: "collV1"}});
+ return res.cursor.firstBatch.length === 1;
+ }, "Collection with v:1 _id index failed to sync on slave");
// Check _id index versions on slave.
spec = GetIndexHelpers.findByName(slaveDB.collV2.getIndexes(), "_id_");