diff options
-rw-r--r-- | etc/backports_required_for_multiversion_tests.yml | 2 | ||||
-rw-r--r-- | jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js | 17 | ||||
-rw-r--r-- | src/mongo/db/op_observer_impl.cpp | 16 |
3 files changed, 2 insertions, 33 deletions
diff --git a/etc/backports_required_for_multiversion_tests.yml b/etc/backports_required_for_multiversion_tests.yml index 28766a9220e..8a72b94f655 100644 --- a/etc/backports_required_for_multiversion_tests.yml +++ b/etc/backports_required_for_multiversion_tests.yml @@ -42,8 +42,6 @@ replica_sets_jscore_multiversion_passthrough: test_file: jstests/core/wildcard_index_partial_index.js - ticket: SERVER-48993 test_file: jstests/core/explode_for_sort_collation.js -- ticket: SERVER-48525 - test_file: jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js sharding_jscore_multiversion_passthrough: - ticket: SERVER-47773 diff --git a/jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js b/jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js index 0358f3cdfba..067bf1482fa 100644 --- a/jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js +++ b/jstests/core/txns/no_writes_to_config_transactions_with_prepared_transaction.js @@ -70,24 +70,11 @@ transactionEntry = config.transactions.findOne(); assert(transactionEntry); jsTestLog("Test that dropping config.transactions fails when there is a prepared transaction" + - " present"); -jsTestLog("[1] collection drop in the same session"); + " on the session"); assert.commandFailedWithCode(assert.throws(function() { sessionConfigDB.transactions.drop(); }), - [4852500, 40528]); -jsTestLog("[2] collection drop not in a session"); -assert.commandFailedWithCode(assert.throws(function() { - config.transactions.drop(); - }), - 4852500); - -jsTestLog("Test that dropping the config db fails when there is a prepared transaction" + - " present"); -jsTestLog("[3] database drop in the same session"); -assert.commandFailedWithCode(sessionConfigDB.dropDatabase(), [4852500, 40528]); -jsTestLog("[4] database drop not in a session"); -assert.commandFailedWithCode(config.dropDatabase(), 4852500); + 40528); jsTestLog("Test that we can prepare a transaction on a different session"); const session2 = db.getMongo().startSession({causalConsistency: false}); diff --git a/src/mongo/db/op_observer_impl.cpp b/src/mongo/db/op_observer_impl.cpp index 78b15ad003e..bb935f1cfb7 100644 --- a/src/mongo/db/op_observer_impl.cpp +++ b/src/mongo/db/op_observer_impl.cpp @@ -778,22 +778,6 @@ repl::OpTime OpObserverImpl::onDropCollection(OperationContext* opCtx, if (collectionName.coll() == DurableViewCatalog::viewsCollectionName()) { DurableViewCatalog::onSystemViewsCollectionDrop(opCtx, collectionName); } else if (collectionName == NamespaceString::kSessionTransactionsTableNamespace) { - // Disallow this drop if there are currently prepared transactions. - const auto sessionCatalog = SessionCatalog::get(opCtx); - SessionKiller::Matcher matcherAllSessions( - KillAllSessionsByPatternSet{makeKillAllSessionsByPattern(opCtx)}); - bool noPreparedTxns = true; - sessionCatalog->scanSessions(matcherAllSessions, [&](const ObservableSession& session) { - auto txnParticipant = TransactionParticipant::get(session); - if (txnParticipant.transactionIsPrepared()) { - noPreparedTxns = false; - } - }); - uassert(4852500, - "Unable to drop transactions table (config.transactions) while prepared " - "transactions are present.", - noPreparedTxns); - MongoDSessionCatalog::invalidateAllSessions(opCtx); } else if (collectionName == NamespaceString::kConfigSettingsNamespace) { ReadWriteConcernDefaults::get(opCtx).invalidate(); |