diff options
author | Pavi Vetriselvan <pvselvan@umich.edu> | 2018-10-30 14:45:38 -0400 |
---|---|---|
committer | Pavi Vetriselvan <pvselvan@umich.edu> | 2018-10-30 14:52:19 -0400 |
commit | 33ac1afd4079e04d12554f9b79d1ab07426caf59 (patch) | |
tree | e18f05ce76cec36901b76ed4cf8f6ba2ba97fb99 /jstests/replsets | |
parent | 6d475fdb5a76acab760ce4b6709b60a4c8c9aec6 (diff) | |
download | mongo-33ac1afd4079e04d12554f9b79d1ab07426caf59.tar.gz |
SERVER-35811 pin stable timestamp behind oldest uncommitted timestamp
Diffstat (limited to 'jstests/replsets')
3 files changed, 22 insertions, 12 deletions
diff --git a/jstests/replsets/commit_transaction_recovery.js b/jstests/replsets/commit_transaction_recovery.js index 1f40a13938a..00b163b8dcc 100644 --- a/jstests/replsets/commit_transaction_recovery.js +++ b/jstests/replsets/commit_transaction_recovery.js @@ -48,7 +48,8 @@ // Perform a clean shutdown and restart. Note that the 'disableSnapshotting' failpoint will be // unset on the node following the restart. - replTest.restart(primary); + replTest.stop(primary, undefined, {skipValidation: true}); + replTest.start(primary, {}, true); jsTestLog("Node was restarted"); diff --git a/jstests/replsets/commit_transaction_recovery_data_already_applied.js b/jstests/replsets/commit_transaction_recovery_data_already_applied.js index d5fc83946db..5ca3326dd38 100644 --- a/jstests/replsets/commit_transaction_recovery_data_already_applied.js +++ b/jstests/replsets/commit_transaction_recovery_data_already_applied.js @@ -68,7 +68,8 @@ // will error with BSONTooLarge only if recovery reapplies the operations from the transaction. // Note that the 'disableSnapshotting' failpoint will be unset on the node following the // restart. - replTest.restart(primary); + replTest.stop(primary, undefined, {skipValidation: true}); + replTest.start(primary, {}, true); jsTestLog("Node was restarted"); diff --git a/jstests/replsets/prepare_conflict_read_concern_behavior.js b/jstests/replsets/prepare_conflict_read_concern_behavior.js index 3828dea4426..6106248f52b 100644 --- a/jstests/replsets/prepare_conflict_read_concern_behavior.js +++ b/jstests/replsets/prepare_conflict_read_concern_behavior.js @@ -66,11 +66,13 @@ .operationTime; 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: 3, in_prepared_txn: 3}], writeConcern: {w: "majority"}})) + .commandWorked( + testColl.runCommand("insert", {documents: [{_id: 3, in_prepared_txn: 3}]})) .operationTime; jsTestLog("prepareTimestamp: " + prepareTimestamp + " clusterTimeBeforePrepare: " + @@ -80,9 +82,12 @@ assert.gt(prepareTimestamp, clusterTimeBeforePrepare); assert.gt(clusterTimeAfterPrepare, prepareTimestamp); - jsTestLog( - "Test read with read concern 'majority' doesn't block on a prepared transaction."); - assert.commandWorked(read({level: 'majority'}, successTimeout, testDB, collName, 2)); + // 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 'local' doesn't block on a prepared transaction."); assert.commandWorked(read({level: 'local'}, successTimeout, testDB, collName, 2)); @@ -131,10 +136,13 @@ session2.startTransaction( {readConcern: {level: "snapshot", atClusterTime: clusterTimeAfterPrepare}}); - 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)); + // 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 blocks on a prepared transaction."); |