diff options
author | Pavi Vetriselvan <pvselvan@umich.edu> | 2019-04-01 13:42:11 -0400 |
---|---|---|
committer | Pavi Vetriselvan <pvselvan@umich.edu> | 2019-04-01 14:05:19 -0400 |
commit | e433a5aee915568cf73b05e89597903855ed1952 (patch) | |
tree | 6c05ba3dab362405e8d07cc5bf65ea86003ddbbf /jstests/replsets/prepare_conflict_read_concern_behavior.js | |
parent | e96547906836a12d76b7a1591a0028b1fff8cb79 (diff) | |
download | mongo-e433a5aee915568cf73b05e89597903855ed1952.tar.gz |
Revert "SERVER-35811 disallow committing at the prepareTimestamp and pin stable TS before oldest uncommitted TS"
This reverts commit b58420e57a2149c350ebf82815fe708850402296 and 33ac1afd4079e04d12554f9b79d1ab07426caf59.
Diffstat (limited to 'jstests/replsets/prepare_conflict_read_concern_behavior.js')
-rw-r--r-- | jstests/replsets/prepare_conflict_read_concern_behavior.js | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/jstests/replsets/prepare_conflict_read_concern_behavior.js b/jstests/replsets/prepare_conflict_read_concern_behavior.js index 58efe922fa4..4327f7d86c5 100644 --- a/jstests/replsets/prepare_conflict_read_concern_behavior.js +++ b/jstests/replsets/prepare_conflict_read_concern_behavior.js @@ -69,13 +69,11 @@ assert.commandWorked(sessionColl.update({_id: 2}, {_id: 2, in_prepared_txn: true})); const prepareTimestamp = PrepareHelpers.prepareTransaction(session); - // TODO: Once we no longer hold the stable optime behind the earliest prepare optime - // whose corresponding commit/abort oplog entry optime is not majority committed, allow - // this insert to be majority committed. const clusterTimeAfterPrepare = assert - .commandWorked( - testColl.runCommand("insert", {documents: [{_id: 4, in_prepared_txn: false}]})) + .commandWorked(testColl.runCommand( + "insert", + {documents: [{_id: 4, in_prepared_txn: false}], writeConcern: {w: "majority"}})) .operationTime; jsTestLog("prepareTimestamp: " + prepareTimestamp + " clusterTimeBeforePrepare: " + @@ -85,12 +83,9 @@ assert.gt(prepareTimestamp, clusterTimeBeforePrepare); assert.gt(clusterTimeAfterPrepare, prepareTimestamp); - // TODO: Once we no longer hold the stable optime behind the earliest prepare optime - // whose corresponding commit/abort oplog entry optime is not majority committed, uncomment - // this read. - // jsTestLog( - // "Test read with read concern 'majority' doesn't block on a prepared transaction."); - // assert.commandWorked(read({level: 'majority'}, successTimeout, testDB, collName, 2)); + jsTestLog( + "Test read with read concern 'majority' doesn't block on a prepared transaction."); + assert.commandWorked(read({level: 'majority'}, successTimeout, testDB, collName, 3)); jsTestLog("Test read with read concern 'local' doesn't block on a prepared transaction."); assert.commandWorked(read({level: 'local'}, successTimeout, testDB, collName, 3)); @@ -147,13 +142,10 @@ session2.startTransaction( {readConcern: {level: "snapshot", atClusterTime: clusterTimeAfterPrepare}}); - // TODO: Once we no longer hold the stable optime behind the earliest prepare optime - // whose corresponding commit/abort oplog entry optime is not majority committed, uncomment - // this read. - // jsTestLog("Test read with read concern 'snapshot' and a read timestamp after " + - // "prepareTimestamp on non-prepared documents doesn't block on a prepared " + - // "transaction."); - // assert.commandWorked(read({}, failureTimeout, sessionDB2, collName2, 1)); + jsTestLog("Test read with read concern 'snapshot' and a read timestamp after " + + "prepareTimestamp on non-prepared documents doesn't block on a prepared " + + "transaction."); + assert.commandWorked(read({}, failureTimeout, sessionDB2, collName2, 1)); jsTestLog("Test read with read concern 'snapshot' and a read timestamp after " + "prepareTimestamp blocks on a prepared transaction."); |