summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@mongodb.com>2022-01-28 16:26:45 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-31 16:39:07 +0000
commite1b81f363ccae3f9892815e5874b9a39665d8ebb (patch)
tree49b0f1bac3e0bf6253a1ae8824da4b804888fe6e
parent257c12f640de47030fa11b30a45cd218748f6b60 (diff)
downloadmongo-e1b81f363ccae3f9892815e5874b9a39665d8ebb.tar.gz
SERVER-63118 Wait for writes to become durable before killing node in startup_recovery_for_restore.js
-rw-r--r--jstests/replsets/startup_recovery_for_restore.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/jstests/replsets/startup_recovery_for_restore.js b/jstests/replsets/startup_recovery_for_restore.js
index a20ec3199b5..4af773c50d0 100644
--- a/jstests/replsets/startup_recovery_for_restore.js
+++ b/jstests/replsets/startup_recovery_for_restore.js
@@ -126,8 +126,9 @@ assert.commandFailed(restoreNode.adminCommand({fsync: 1}));
jsTestLog("Doing more write on the primary");
assert.commandWorked(db.runCommand({insert: sentinelCollName, documents: [{_id: "s3"}]}));
-// Make sure we can read the new write on the restore node.
-rst.awaitReplication(undefined, undefined, [restoreNode]);
+// Make sure we can read the new write on the restore node. Must be durable because we're about
+// to crash this node with no checkpoints.
+rst.awaitReplication(undefined, ReplSetTest.OpTimeType.LAST_DURABLE, [restoreNode]);
assert.eq(3, restoreNode.getDB(dbName)[sentinelCollName].find({}).itcount());
jsTestLog("Crashing restore node before it takes the first stable checkpoint");