diff options
Diffstat (limited to 'src/mongo/db/repl/tenant_migration_recipient_service.cpp')
-rw-r--r-- | src/mongo/db/repl/tenant_migration_recipient_service.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/repl/tenant_migration_recipient_service.cpp b/src/mongo/db/repl/tenant_migration_recipient_service.cpp index 7e910a2a30d..94d7a0a4f70 100644 --- a/src/mongo/db/repl/tenant_migration_recipient_service.cpp +++ b/src/mongo/db/repl/tenant_migration_recipient_service.cpp @@ -939,6 +939,13 @@ void TenantMigrationRecipientService::Instance::_processCommittedTransactionEntr << txnNumber << " on session " << sessionId, txnParticipant); + // The in-memory transaction state may have been updated past the on-disk transaction state. For + // instance, this might happen in an unprepared read-only transaction, which updates in-memory + // but not on-disk. To prevent potential errors, we use the on-disk state for the following + // transaction number checks. + txnParticipant.invalidate(opCtx); + txnParticipant.refreshFromStorageIfNeeded(opCtx); + // If the entry's transaction number is stale/older than the current active transaction number // on the participant, fail the migration. uassert(ErrorCodes::TransactionTooOld, |