summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/replsets/retryable_prepared_commit_transaction_after_failover.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/jstests/replsets/retryable_prepared_commit_transaction_after_failover.js b/jstests/replsets/retryable_prepared_commit_transaction_after_failover.js
index ba3a15b83aa..7816453c50c 100644
--- a/jstests/replsets/retryable_prepared_commit_transaction_after_failover.js
+++ b/jstests/replsets/retryable_prepared_commit_transaction_after_failover.js
@@ -47,6 +47,9 @@ assert.commandFailedWithCode(
priSessionDB.adminCommand({commitTransaction: 1, commitTimestamp: tooEarlyTS1}),
ErrorCodes.InvalidOptions);
+// Wait for the commit point to be propagated to the secondary before stepping it up.
+rst.awaitLastOpCommitted();
+
jsTestLog("Step up the secondary");
rst.stepUp(secConn);
assert.eq(secConn, rst.getPrimary());