summaryrefslogtreecommitdiff
path: root/jstests/replsets/libs/rollback_test.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/libs/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