summaryrefslogtreecommitdiff
path: root/jstests/replsets/assert_on_prepare_conflict_with_hole.js
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2021-06-08 22:34:55 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-09 02:55:29 +0000
commit990f8ede6f89e44315688d4f679c28ff53b672d1 (patch)
tree308996b813e687f99e89e56fe587b94ce31425e7 /jstests/replsets/assert_on_prepare_conflict_with_hole.js
parent44419183dfabb246c0a112f6060a372e90ee0d44 (diff)
downloadmongo-990f8ede6f89e44315688d4f679c28ff53b672d1.tar.gz
Revert "SERVER-57476: Return a WriteConflict when a timestamped transaction hits a prepare conflict."
This reverts commit 44419183dfabb246c0a112f6060a372e90ee0d44.
Diffstat (limited to 'jstests/replsets/assert_on_prepare_conflict_with_hole.js')
-rw-r--r--jstests/replsets/assert_on_prepare_conflict_with_hole.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/jstests/replsets/assert_on_prepare_conflict_with_hole.js b/jstests/replsets/assert_on_prepare_conflict_with_hole.js
deleted file mode 100644
index c4075ff69b0..00000000000
--- a/jstests/replsets/assert_on_prepare_conflict_with_hole.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Constructs the following cycle that can lead to stalling a sharded cluster:
- * | Preparer | VectoredInsert | OplogVisibility Ts |
- * |---------------------------------------+---------------------------+--------------------|
- * | BeginTxn | | |
- * | Write A | | |
- * | | BeginTxn | |
- * | | Preallocates TS(10, 11) | 9 |
- * | (side txn commits prepare oplog @ 12) | | |
- * | Prepare 12 | | |
- * | | Write A (PrepareConflict) | |
- *
- * In this scenario, the prepared transaction blocks waiting for its prepare oplog entry at
- * timestamp 12 to become majority committed. However, the prepare oplog entry cannot replicate to
- * secondaries until the oplog visibility timestamp advances to 12. The oplog visibility timestamp
- * advancing is blocked on the VectoredInsert that allocated timestamps 10 and 11. The
- * VectoredInsert cannot make progress because it has hit a prepare conflict.
- *
- * @tags: [uses_transactions, uses_prepare_transaction]
- */
-(function() {
-"use strict";
-
-const rst = new ReplSetTest({nodes: 1});
-rst.startSet();
-rst.initiate();
-
-const primary = rst.getPrimary();
-const db = primary.getDB("test");
-
-const collName = "mycoll";
-assert.commandWorked(db.runCommand({create: collName, writeConcern: {w: "majority"}}));
-assert.commandWorked(db[collName].createIndex({a: 1}, {unique: true}));
-
-const lsid = ({id: UUID()});
-assert.commandWorked(db.runCommand({
- insert: collName,
- documents: [{a: 2}],
- lsid,
- txnNumber: NumberLong(1),
- autocommit: false,
- startTransaction: true,
-}));
-
-assert.commandWorked(
- db.adminCommand({prepareTransaction: 1, lsid, txnNumber: NumberLong(1), autocommit: false}));
-
-assert.commandFailedWithCode(db[collName].insert([{a: 1}, {a: 2}, {a: 3}]),
- ErrorCodes.WriteConflict);
-
-rst.stop(primary, null, {allowedExitCode: MongoRunner.EXIT_ABRUPT});
-rst.stopSet();
-})();