Skip to content

Commit 710ccfe

Browse files
committed
SERVER-42481 Remove FCV checks around prepared transactions
1 parent 2f815db commit 710ccfe

File tree

4 files changed

+9
-74
lines changed

4 files changed

+9
-74
lines changed

jstests/core/txns/abort_unprepared_transactions_on_FCV_downgrade.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
// Test that open unprepared transactions are aborted on FCV downgrade.
2-
// @tags: [uses_transactions]
1+
/**
2+
* Test that open unprepared transactions are aborted on FCV downgrade. This test covers the
3+
* behavior between FCV downgrade and unprepared transactions as of v4.2. It is safe to change this
4+
* test's behavior or remove this test entirely if the behavior changes post v4.2.
5+
* @tags: [uses_transactions]
6+
*/
37
(function() {
48
"use strict";
59
load("jstests/libs/feature_compatibility_version.js");

jstests/core/txns/await_prepared_transactions_on_FCV_downgrade.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
2-
* Test that we wait for prepared transactions to finish during downgrade to FCV 4.0.
2+
* Test that we wait for prepared transactions to finish during FCV downgrade. This test covers the
3+
* locking behavior as of v4.2. It is safe to change this test's behavior or remove this test
4+
* entirely if the locking behavior changes post v4.2.
35
* @tags: [uses_transactions, uses_prepare_transaction]
46
*/
57
(function() {
@@ -50,13 +52,6 @@ try {
5052
assert.commandWorked(testDB.adminCommand({setFeatureCompatibilityVersion: lastStableFCV}));
5153
checkFCV(adminDB, lastStableFCV);
5254

53-
jsTestLog("Verify that we are not allowed to prepare a transaction after downgrading.");
54-
session.startTransaction();
55-
assert.commandWorked(sessionDB[collName].insert({"b": 2}));
56-
assert.commandFailedWithCode(sessionDB.adminCommand({prepareTransaction: 1}),
57-
ErrorCodes.CommandNotSupported);
58-
assert.commandFailedWithCode(session.abortTransaction_forTesting(),
59-
ErrorCodes.NoSuchTransaction);
6055
} finally {
6156
assert.commandWorked(
6257
testDB.adminCommand({configureFailPoint: "failNonIntentLocksIfWaitNeeded", mode: "off"}));

jstests/core/txns/prepare_requires_fcv42.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/mongo/db/s/txn_two_phase_commit_cmds.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ class PrepareTransactionCmd : public TypedCommand<PrepareTransactionCmd> {
103103
<< opCtx->getTxnNumber() << " on session "
104104
<< opCtx->getLogicalSessionId()->toBSON();
105105

106-
uassert(ErrorCodes::CommandNotSupported,
107-
"'prepareTransaction' is only supported in feature compatibility version 4.2",
108-
(serverGlobalParams.featureCompatibility.getVersion() ==
109-
ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo42));
110-
111106
uassert(ErrorCodes::NoSuchTransaction,
112107
"Transaction isn't in progress",
113108
txnParticipant.inMultiDocumentTransaction());

0 commit comments

Comments
 (0)