diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2021-05-27 15:21:06 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-28 15:15:52 +0000 |
commit | 09617a6bca8ae249435b904155b721cf293877e4 (patch) | |
tree | d303735a031b49d6178b12eaabdb39e5b55d6606 | |
parent | 1b3a206dfe6df7257f0786eecb507df66773b3f4 (diff) | |
download | mongo-09617a6bca8ae249435b904155b721cf293877e4.tar.gz |
SERVER-48711 Remove FCV guard from transient_txn_error_labels_with_write_concern.js
-rw-r--r-- | jstests/sharding/transient_txn_error_labels_with_write_concern.js | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/jstests/sharding/transient_txn_error_labels_with_write_concern.js b/jstests/sharding/transient_txn_error_labels_with_write_concern.js index 37c54475706..5838db045fa 100644 --- a/jstests/sharding/transient_txn_error_labels_with_write_concern.js +++ b/jstests/sharding/transient_txn_error_labels_with_write_concern.js @@ -11,8 +11,6 @@ load("jstests/libs/fail_point_util.js"); load("jstests/libs/write_concern_util.js"); load("jstests/replsets/rslib.js"); -const clusterInFCV44 = jsTestOptions().mongosBinVersion != 'last-lts'; - const dbName = "test"; const collName = "transient_txn_error_labels_with_write_concern"; @@ -82,30 +80,26 @@ function runNoSuchTransactionTests(cmd, cmdName) { assert(!res.hasOwnProperty("writeConcernError"), res); assert.eq(res["errorLabels"], ["TransientTransactionError"], res); - // Failpoint failTransactionNoopWrite doesn't exist in mongo versions <= 4.4 - if (clusterInFCV44) { - jsTest.log( - "If the noop write for NoSuchTransaction cannot occur, the error is not transient"); - - const failpoint = configureFailPoint(primary, "failTransactionNoopWrite"); - - // The server will attempt to perform a noop write, since the command returns - // NoSuchTransaction. The noop write will time out because of the failpoint. - // This should not be a TransientTransactionError, since the server has not successfully - // replicated a write to confirm that it is primary. - // Use a txnNumber that is one higher than the server has tracked. - res = sessionDb.adminCommand(Object.assign(Object.assign({}, cmd), { - txnNumber: NumberLong(session.getTxnNumber_forTesting() + 1), - autocommit: false, - writeConcern: writeConcernMajority, - maxTimeMS: 1000 - })); - - failpoint.off(); - - assert.commandFailedWithCode(res, ErrorCodes.MaxTimeMSExpired); - assert(!res.hasOwnProperty("errorLabels")); - } + jsTest.log("If the noop write for NoSuchTransaction cannot occur, the error is not transient"); + + const failpoint = configureFailPoint(primary, "failTransactionNoopWrite"); + + // The server will attempt to perform a noop write, since the command returns + // NoSuchTransaction. The noop write will time out because of the failpoint. + // This should not be a TransientTransactionError, since the server has not successfully + // replicated a write to confirm that it is primary. + // Use a txnNumber that is one higher than the server has tracked. + res = sessionDb.adminCommand(Object.assign(Object.assign({}, cmd), { + txnNumber: NumberLong(session.getTxnNumber_forTesting() + 1), + autocommit: false, + writeConcern: writeConcernMajority, + maxTimeMS: 1000 + })); + + failpoint.off(); + + assert.commandFailedWithCode(res, ErrorCodes.MaxTimeMSExpired); + assert(!res.hasOwnProperty("errorLabels")); rst.awaitReplication(); } |