diff options
| author | Gregory Noma <gregory.noma@gmail.com> | 2024-09-17 16:24:10 -0400 |
|---|---|---|
| committer | MongoDB Bot <mongo-bot@mongodb.com> | 2024-09-17 21:05:55 +0000 |
| commit | 52ace13e97475841ce2d2c0f4f4648111b7be1ec (patch) | |
| tree | 86573cff1f9dc125a4630b19215b905c6a807945 /src/mongo/db/repl/rollback_impl.cpp | |
| parent | 5c02ebfa2b250436807794cd21c5cc60d8e1caf6 (diff) | |
SERVER-94743 Get replication coordinator out of WT KV engine (#27016)
GitOrigin-RevId: c3784e32978a0436b815ddbb5fd5db448b60bc84
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.cpp')
| -rw-r--r-- | src/mongo/db/repl/rollback_impl.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/db/repl/rollback_impl.cpp b/src/mongo/db/repl/rollback_impl.cpp index da9dfc7e95a..a32cf18ef20 100644 --- a/src/mongo/db/repl/rollback_impl.cpp +++ b/src/mongo/db/repl/rollback_impl.cpp @@ -267,10 +267,20 @@ Status RollbackImpl::runRollback(OperationContext* opCtx) { rollbackHangAfterTransitionToRollback.pauseWhileSet(opCtx); } + auto& sizeRecovery = sizeRecoveryState(opCtx->getServiceContext()); + // We clear the SizeRecoveryState before we recover to a stable timestamp. This ensures that we // only use size adjustment markings from the storage and replication recovery processes in this // rollback. - sizeRecoveryState(opCtx->getServiceContext()).clearStateBeforeRecovery(); + sizeRecovery.clearStateBeforeRecovery(); + + // Sizes should always be checked when creating a collection during rollback. This is in case + // the size storer information is no longer accurate. This may be necessary if capped deletes + // are rolled-back or if rollback occurs across a collection rename. + sizeRecovery.setRecordStoresShouldAlwaysCheckSize(true); + ScopeGuard sizeRecoveryStateGuard{[&sizeRecovery] { + sizeRecovery.setRecordStoresShouldAlwaysCheckSize(false); + }}; // After successfully transitioning to the ROLLBACK state, we must always transition back to // SECONDARY, even if we fail at any point during the rollback process. |
