summaryrefslogtreecommitdiff
path: root/src/mongo/db/startup_recovery.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-07-31 14:07:22 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-31 18:57:12 +0000
commite7612ffc6eff9a30ff4e45f85c00636d5ba067c4 (patch)
treec18a4a13c5484417296c4fe9e0c50f84a4610f71 /src/mongo/db/startup_recovery.cpp
parent250099011ecd72c4d204af769fc48da551eeacc1 (diff)
downloadmongo-e7612ffc6eff9a30ff4e45f85c00636d5ba067c4.tar.gz
SERVER-49301 StorageEngineImpl::reconcileCatalogAndIdents() accepts policy for internal idents instead of checking unclean shutdown decorator
Diffstat (limited to 'src/mongo/db/startup_recovery.cpp')
-rw-r--r--src/mongo/db/startup_recovery.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/startup_recovery.cpp b/src/mongo/db/startup_recovery.cpp
index 80a8376154a..c7be25d6e87 100644
--- a/src/mongo/db/startup_recovery.cpp
+++ b/src/mongo/db/startup_recovery.cpp
@@ -336,7 +336,15 @@ void reconcileCatalogAndRebuildUnfinishedIndexes(
OperationContext* opCtx,
StorageEngine* storageEngine,
LastStorageEngineShutdownState lastStorageEngineShutdownState) {
- auto reconcileResult = fassert(40593, storageEngine->reconcileCatalogAndIdents(opCtx));
+
+ // When starting up after an unclean shutdown, we do not attempt to recover any state from the
+ // internal idents. Thus, we drop them in this case.
+ auto reconcilePolicy =
+ LastStorageEngineShutdownState::kUnclean == lastStorageEngineShutdownState
+ ? StorageEngine::InternalIdentReconcilePolicy::kDrop
+ : StorageEngine::InternalIdentReconcilePolicy::kRetain;
+ auto reconcileResult =
+ fassert(40593, storageEngine->reconcileCatalogAndIdents(opCtx, reconcilePolicy));
// Determine which indexes need to be rebuilt. rebuildIndexesOnCollection() requires that all
// indexes on that collection are done at once, so we use a map to group them together.