diff options
author | Erin Liang <erin.liang@mongodb.com> | 2022-06-28 16:34:47 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-28 18:07:45 +0000 |
commit | a07e8767363fbcd9f9d049516193b55f958b6999 (patch) | |
tree | 282a613623789eb740dd4216a8bb827b222341f6 /jstests | |
parent | 3a0fa6b5289a3cdaf4a19031ca4ec99dc394ff33 (diff) | |
download | mongo-a07e8767363fbcd9f9d049516193b55f958b6999.tar.gz |
SERVER-65397 Remove featureFlagInternalTransactions
Diffstat (limited to 'jstests')
4 files changed, 5 insertions, 97 deletions
diff --git a/jstests/concurrency/fsm_workloads/random_internal_transactions_setFCV_operations.js b/jstests/concurrency/fsm_workloads/random_internal_transactions_setFCV_operations.js index 84acc9fcd50..c1181458ded 100644 --- a/jstests/concurrency/fsm_workloads/random_internal_transactions_setFCV_operations.js +++ b/jstests/concurrency/fsm_workloads/random_internal_transactions_setFCV_operations.js @@ -21,7 +21,6 @@ load('jstests/concurrency/fsm_workloads/random_moveChunk_update_shard_key.js'); load('jstests/libs/override_methods/retry_on_killed_session.js'); var $config = extendWorkload($config, function($config, $super) { - $config.data.areInternalTransactionsEnabled = true; // Sessions of open transactions can be killed and throw "Interrupted" if we run it concurrently // with a setFCV command, so we want to be able to catch those as acceptable killSession errors. $config.data.retryOnKilledSession = true; diff --git a/jstests/multiVersion/internal_transactions_during_downgrade.js b/jstests/multiVersion/internal_transactions_during_downgrade.js deleted file mode 100644 index dd4a59aef2f..00000000000 --- a/jstests/multiVersion/internal_transactions_during_downgrade.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Tests the setFCV command kills internal sessions with unprepared transactions that start - * immediately before the FCV change and abort those transactions. - * - * @tags: [uses_transactions] - */ -(function() { -'use strict'; - -load("jstests/libs/fail_point_util.js"); -load("jstests/libs/parallelTester.js"); - -function runInternalTxn(primaryHost, isStandaloneRst) { - load("jstests/sharding/libs/sharded_transactions_helpers.js"); - - const primary = new Mongo(primaryHost); - - const kDbName = "testDb"; - const kCollName = "testColl"; - let testDB = primary.getDB(kDbName); - - const sessionUUID = UUID(); - const parentLsid = {id: sessionUUID}; - const parentTxnNumber = NumberLong(35); - const childLsid = {id: parentLsid.id, txnNumber: parentTxnNumber, txnUUID: UUID()}; - const childTxnNumber = NumberLong(0); - const stmtId = NumberInt(1); - - const findAndModifyCmdObj = { - findAndModify: kCollName, - query: {_id: 0, x: 0}, - update: {$inc: {x: 1}}, - upsert: true, - lsid: childLsid, - txnNumber: childTxnNumber, - startTransaction: true, - autocommit: false, - stmtId: stmtId, - }; - const commitCmdObj = makeCommitTransactionCmdObj(childLsid, childTxnNumber); - - assert.commandFailedWithCode(testDB.runCommand(findAndModifyCmdObj), ErrorCodes.Interrupted); - assert.commandFailedWithCode(testDB.adminCommand(commitCmdObj), ErrorCodes.NoSuchTransaction); -} - -function runTest(rst, isStandaloneRst) { - const primary = rst.getPrimary(); - let fp = configureFailPoint(primary, "hangAfterCheckingInternalTransactionsFeatureFlag"); - - const internalTxnThread = new Thread(runInternalTxn, primary.host, isStandaloneRst); - internalTxnThread.start(); - fp.wait(); - - jsTest.log("Starting setFCV"); - assert.commandWorked(primary.adminCommand({setFeatureCompatibilityVersion: lastLTSFCV})); - jsTest.log("Finished setFCV"); - - fp.off(); - internalTxnThread.join(); - - assert.eq(null, primary.getCollection("config.transactions").findOne()); -} - -{ - const st = new ShardingTest({shards: 1}); - runTest(st.rs0, false /* isStandaloneRst */); - st.stop(); -} - -{ - const rst = new ReplSetTest({nodes: 1}); - rst.startSet(); - rst.initiate(); - runTest(rst, true /* isStandaloneRst */); - rst.stopSet(); -} -})(); diff --git a/jstests/noPassthrough/transaction_coordinator_curop_info.js b/jstests/noPassthrough/transaction_coordinator_curop_info.js index be2e66a7568..2c246d3b020 100644 --- a/jstests/noPassthrough/transaction_coordinator_curop_info.js +++ b/jstests/noPassthrough/transaction_coordinator_curop_info.js @@ -52,8 +52,7 @@ function curOpAfterFailpoint(failPoint, filter, timesEntered = 1) { return result; } -function makeWorkerFilterWithAction( - session, action, txnNumber, txnRetryCounter, areInternalTransactionsEnabled) { +function makeWorkerFilterWithAction(session, action, txnNumber, txnRetryCounter) { var filter = { 'twoPhaseCommitCoordinator.lsid.id': session.getSessionId().id, 'twoPhaseCommitCoordinator.txnNumber': NumberLong(txnNumber), @@ -61,10 +60,8 @@ function makeWorkerFilterWithAction( 'twoPhaseCommitCoordinator.startTime': {$exists: true} }; - if (areInternalTransactionsEnabled) { - Object.assign(filter, - {'twoPhaseCommitCoordinator.txnRetryCounter': NumberInt(txnRetryCounter)}); - } + Object.assign(filter, + {'twoPhaseCommitCoordinator.txnRetryCounter': NumberInt(txnRetryCounter)}); return filter; } @@ -113,9 +110,6 @@ const failPointNames = [ 'hangBeforeDeletingCoordinatorDoc', 'hangBeforeSendingAbort' ]; -const areInternalTransactionsEnabled = - assert.commandWorked(st.s.adminCommand({getParameter: 1, featureFlagInternalTransactions: 1})) - .featureFlagInternalTransactions.value; assert.commandWorked(st.s.adminCommand({enableSharding: dbName})); assert.commandWorked(st.s.adminCommand({movePrimary: dbName, to: coordinator.shardName})); @@ -204,8 +198,8 @@ jsTest.log("Testing that coordinator threads show up in currentOp for an abort d let commitJoin = commitTxn(st, lsid, txnNumber, ErrorCodes.NoSuchTransaction); - const sendAbortFilter = makeWorkerFilterWithAction( - session, "sendingAbort", txnNumber, txnRetryCounter, areInternalTransactionsEnabled); + const sendAbortFilter = + makeWorkerFilterWithAction(session, "sendingAbort", txnNumber, txnRetryCounter); let sendingAbortOp = curOpAfterFailpoint(failPoints['hangBeforeSendingAbort'], sendAbortFilter, numShards); assert.eq(numShards, sendingAbortOp.length); diff --git a/jstests/sharding/libs/sharded_transactions_helpers.js b/jstests/sharding/libs/sharded_transactions_helpers.js index 5c4d594f972..79b07dceb08 100644 --- a/jstests/sharding/libs/sharded_transactions_helpers.js +++ b/jstests/sharding/libs/sharded_transactions_helpers.js @@ -261,14 +261,6 @@ function makePrepareTransactionCmdObj(lsid, txnNumber) { }; } -function areInternalTransactionsEnabled(conn) { - return jsTestOptions().mongosBinVersion !== "last-lts" && - jsTestOptions().mongosBinVersion !== "last-continuous" && - assert - .commandWorked(conn.adminCommand({getParameter: 1, featureFlagInternalTransactions: 1})) - .featureFlagInternalTransactions.value; -} - function isUpdateDocumentShardKeyUsingTransactionApiEnabled(conn) { return jsTestOptions().mongosBinVersion !== "last-lts" && jsTestOptions().mongosBinVersion !== "last-continuous" && |