diff options
author | Jason Zhang <jason.zhang@mongodb.com> | 2022-02-03 16:02:58 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-03 17:13:45 +0000 |
commit | 0e4e2c4a28fee3358ff2f0f0f102f0e8b59185d0 (patch) | |
tree | 847a267aa8f93f167bd8d52da2078e35ab4a670b /jstests/multiVersion/targetedTestsLastLtsFeatures | |
parent | 882ebf1ad73b1c39af8b0cd82de7c648b8a860d2 (diff) | |
download | mongo-0e4e2c4a28fee3358ff2f0f0f102f0e8b59185d0.tar.gz |
SERVER-61088 Make transaction participants check if txnRetryCounter is supported during startTransaction and have mongos use it
Diffstat (limited to 'jstests/multiVersion/targetedTestsLastLtsFeatures')
-rw-r--r-- | jstests/multiVersion/targetedTestsLastLtsFeatures/internal_transactions_retry_on_transient_transaction_error.js | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/jstests/multiVersion/targetedTestsLastLtsFeatures/internal_transactions_retry_on_transient_transaction_error.js b/jstests/multiVersion/targetedTestsLastLtsFeatures/internal_transactions_retry_on_transient_transaction_error.js index 1ee491794b1..ff1ea1baffc 100644 --- a/jstests/multiVersion/targetedTestsLastLtsFeatures/internal_transactions_retry_on_transient_transaction_error.js +++ b/jstests/multiVersion/targetedTestsLastLtsFeatures/internal_transactions_retry_on_transient_transaction_error.js @@ -55,15 +55,6 @@ function runTest(downgradeFCV) { jsTest.log("Verify retries only work in FCV latest"); const lsid1 = {id: UUID()}; const txnNumber1 = NumberLong(1); - configureFailPoint(shard0Primary, - "failCommand", - { - failInternalCommands: true, - failCommands: ["insert"], - errorCode: ErrorCodes.LockBusy, - namespace: kNs - }, - {times: 1}); const insertCmdObj = { insert: kCollName, documents: [{x: 1}], @@ -71,14 +62,13 @@ function runTest(downgradeFCV) { txnNumber: txnNumber1, startTransaction: true, autocommit: false, - txnRetryCounter: NumberInt(0) + txnRetryCounter: NumberInt(1) }; - assert.commandFailedWithCode(testDB.runCommand(insertCmdObj), ErrorCodes.InvalidOptions); + assert.commandFailedWithCode(testDB.runCommand(insertCmdObj), + ErrorCodes.TxnRetryCounterNotSupported); assert.commandWorked(st.s.adminCommand({setFeatureCompatibilityVersion: latestFCV})); - - assert.commandFailedWithCode(testDB.runCommand(insertCmdObj), ErrorCodes.LockBusy); - insertCmdObj.txnRetryCounter = NumberInt(1); + insertCmdObj.txnRetryCounter = NumberInt(2); assert.commandWorked(testDB.runCommand(insertCmdObj)); assert.commandWorked(testDB.adminCommand({ commitTransaction: 1, |