summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction_participant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/transaction_participant.cpp')
-rw-r--r--src/mongo/db/transaction_participant.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/transaction_participant.cpp b/src/mongo/db/transaction_participant.cpp
index 298cf5b3cc2..bc56095c641 100644
--- a/src/mongo/db/transaction_participant.cpp
+++ b/src/mongo/db/transaction_participant.cpp
@@ -885,7 +885,10 @@ void TransactionParticipant::Participant::_beginMultiDocumentTransaction(
}
// TODO: (SERVER-62375): Remove upgrade/downgrade code for internal transactions
- if (_isInternalSession()) {
+ if (_isInternalSession() && opCtx->writesAreReplicated()) {
+ // Don't check the FCV and feature flag when starting an internal transaction on secondaries
+ // since they must apply transaction oplog entries replicated from the primary whether or
+ // not there have been changes to the FCV or feature flag.
uassert(ErrorCodes::InternalTransactionNotSupported,
"Internal transactions are not enabled",
feature_flags::gFeatureFlagInternalTransactions.isEnabled(