diff options
author | Cheahuychou Mao <mao.cheahuychou@gmail.com> | 2022-04-28 18:11:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-28 20:28:35 +0000 |
commit | 715c8344c0c325f69b2a8dc7485834e55f5a6b7a (patch) | |
tree | 33a299a742ace3e15d8d078af4cb9aa2fcbd5e47 | |
parent | 76e25c8ede1b979a8681442297afb25e53e7a66f (diff) | |
download | mongo-715c8344c0c325f69b2a8dc7485834e55f5a6b7a.tar.gz |
SERVER-66032 Secondary oplog application failure for prepared internal transactions that span an FCV change
(cherry picked from commit ef9865164e5932a636b11b5373f3c4b38a490df6)
-rw-r--r-- | src/mongo/db/transaction_participant.cpp | 5 |
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( |