summaryrefslogtreecommitdiff
path: root/jstests/disk
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2020-03-11 15:45:15 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-11 22:28:43 +0000
commit4cc0dd868f9fc0fedfae00ee4462e6b7df37d89f (patch)
treee6b6fd546efd03c8dfd328c877324480f953b8df /jstests/disk
parentc6dfd8304c2d6a6b276636b4b17546fd4fc8f8d1 (diff)
downloadmongo-4cc0dd868f9fc0fedfae00ee4462e6b7df37d89f.tar.gz
SERVER-46806 repair_unfinished_indexes.js should startup standalone nodes with 'recoverFromOplogAsStandalone=true'
Diffstat (limited to 'jstests/disk')
-rw-r--r--jstests/disk/repair_unfinished_indexes.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/jstests/disk/repair_unfinished_indexes.js b/jstests/disk/repair_unfinished_indexes.js
index 0f5846757b1..91e2f3b0d3a 100644
--- a/jstests/disk/repair_unfinished_indexes.js
+++ b/jstests/disk/repair_unfinished_indexes.js
@@ -48,7 +48,13 @@ replSet.stop(secondary);
// Confirm that the secondary node leaves the index as unfinished.
(function startAsStandalone() {
jsTestLog("Starting secondary as standalone");
- const mongod = startMongodOnExistingPath(secondaryDbpath);
+ const mongod = startMongodOnExistingPath(
+ secondaryDbpath,
+ // This parameter ensures that when the standalone starts up, it applies all unapplied oplog
+ // entries since the last shutdown. This "smooths out" a race condition in this test where
+ // the secondary can shut down without fully applying the 'startIndexBuild' oplog entry, and
+ // not advancing the stable timestamp to the top of the oplog.
+ {setParameter: 'recoverFromOplogAsStandalone=true'});
IndexBuildTest.assertIndexes(mongod.getDB(dbName).getCollection(collName),
2,
["_id_"],