summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/noPassthrough/index_builds_ignore_prepare_conflicts.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/jstests/noPassthrough/index_builds_ignore_prepare_conflicts.js b/jstests/noPassthrough/index_builds_ignore_prepare_conflicts.js
index 817bdf5901c..f5a0a64eea6 100644
--- a/jstests/noPassthrough/index_builds_ignore_prepare_conflicts.js
+++ b/jstests/noPassthrough/index_builds_ignore_prepare_conflicts.js
@@ -90,6 +90,10 @@
assert.eq(undefined, op.prepareReadConflicts);
});
+ // Because prepare uses w:1, ensure it is majority committed before committing the
+ // transaction.
+ PrepareHelpers.awaitMajorityCommitted(replSetTest, prepareTimestamp);
+
// Commit the transaction before completing the index build, releasing locks which will
// allow the index build to complete.
assert.commandWorked(PrepareHelpers.commitTransaction(session, prepareTimestamp));