diff options
author | Samy Lanka <samy.lanka@mongodb.com> | 2020-05-11 22:15:38 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-12 19:13:43 +0000 |
commit | 5a14578a131325525fc92cbb1ee315ebb35add8d (patch) | |
tree | 2ada84a5899a725e9aef7e897166462dc4941bb6 | |
parent | fdb04688e13a9a8df9abf28b0c9bd95387aabb04 (diff) | |
download | mongo-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.js | 8 |
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 |