summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2020-05-11 22:15:38 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-12 19:13:43 +0000
commit5a14578a131325525fc92cbb1ee315ebb35add8d (patch)
tree2ada84a5899a725e9aef7e897166462dc4941bb6
parentfdb04688e13a9a8df9abf28b0c9bd95387aabb04 (diff)
downloadmongo-5a14578a131325525fc92cbb1ee315ebb35add8d.tar.gz
SERVER-48117 Journal the write used to ensure that rollback happens in rollback_test.js
-rw-r--r--jstests/replsets/libs/rollback_test.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/replsets/libs/rollback_test.js b/jstests/replsets/libs/rollback_test.js
index fc6cc3baf3d..3fc6ffae72c 100644
--- a/jstests/replsets/libs/rollback_test.js
+++ b/jstests/replsets/libs/rollback_test.js
@@ -439,10 +439,14 @@ function RollbackTest(name = "RollbackTest", replSet) {
transitionIfAllowed(State.kSyncSourceOpsBeforeRollback);
- // Insert one document to ensure rollback will not be skipped.
+ // Insert one document to ensure rollback will not be skipped. This needs to be journaled to
+ // ensure that this document is not lost due to unclean shutdowns. Ephemeral and in-memory
+ // storage engines are an exception because journaling isn't supported.
+ let writeConcern = TestData.rollbackShutdowns ? {w: 1, j: true} : {w: 1};
let dbName = "EnsureThereIsAtLeastOneOperationToRollback";
assert.commandWorked(curPrimary.getDB(dbName).ensureRollback.insert(
- {thisDocument: 'is inserted to ensure rollback is not skipped'}));
+ {thisDocument: 'is inserted to ensure rollback is not skipped'},
+ {writeConcern: writeConcern}));
log(`Isolating the primary ${curPrimary.host} so it will step down`);
// We should have already disconnected the primary from the secondary during the first stage