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-19 16:57:43 +0000 |
commit | d25903dee214dbf1ec01e4cd776a8d698edfb6dc (patch) | |
tree | 132eadf7fb97aabc607eda43402eef15528e2bf1 /jstests | |
parent | 5584c9212372ae515981000c2c124e5836780489 (diff) | |
download | mongo-d25903dee214dbf1ec01e4cd776a8d698edfb6dc.tar.gz |
SERVER-48117 Journal the write used to ensure that rollback happens in rollback_test.js
(cherry picked from commit 5a14578a131325525fc92cbb1ee315ebb35add8d)
Diffstat (limited to 'jstests')
-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 47b277315ad..2f728f6c053 100644 --- a/jstests/replsets/libs/rollback_test.js +++ b/jstests/replsets/libs/rollback_test.js @@ -422,10 +422,14 @@ function RollbackTest(name = "RollbackTest", replSet) { this.transitionToSyncSourceOperationsBeforeRollback = function() { 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 |