From 715c8344c0c325f69b2a8dc7485834e55f5a6b7a Mon Sep 17 00:00:00 2001 From: Cheahuychou Mao Date: Thu, 28 Apr 2022 18:11:13 +0000 Subject: SERVER-66032 Secondary oplog application failure for prepared internal transactions that span an FCV change (cherry picked from commit ef9865164e5932a636b11b5373f3c4b38a490df6) --- src/mongo/db/transaction_participant.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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( -- cgit v1.2.1