summaryrefslogtreecommitdiff
path: root/src/mongo/db/repair.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repair.cpp')
-rw-r--r--src/mongo/db/repair.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/repair.cpp b/src/mongo/db/repair.cpp
index b892165cd44..0c06a70d3f9 100644
--- a/src/mongo/db/repair.cpp
+++ b/src/mongo/db/repair.cpp
@@ -201,12 +201,14 @@ Status repairCollection(OperationContext* opCtx,
LOGV2(21027, "Repairing collection", "namespace"_attr = nss);
- auto collection = CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, nss);
+ auto collection =
+ CollectionCatalog::get(opCtx).lookupCollectionByNamespaceForMetadataWrite(opCtx, nss);
Status status = engine->repairRecordStore(opCtx, collection->getCatalogId(), nss);
// Need to lookup from catalog again because the old collection object was invalidated by
// repairRecordStore.
- collection = CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, nss);
+ collection =
+ CollectionCatalog::get(opCtx).lookupCollectionByNamespaceForMetadataWrite(opCtx, nss);
// If data was modified during repairRecordStore, we know to rebuild indexes without needing
// to run an expensive collection validation.