summaryrefslogtreecommitdiff
path: root/src/mongo/db/startup_recovery.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2023-02-09 12:08:10 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-13 16:55:03 +0000
commit78b5bb22426142e49b30c91cff0f1b6e99725047 (patch)
tree7412d4ee181a221884e52126e460eeb40b895776 /src/mongo/db/startup_recovery.cpp
parent13e038d492a20bb52c7f3322603815f503020cf5 (diff)
downloadmongo-78b5bb22426142e49b30c91cff0f1b6e99725047.tar.gz
SERVER-73780 Make CollectionPtr constructor explicit
Diffstat (limited to 'src/mongo/db/startup_recovery.cpp')
-rw-r--r--src/mongo/db/startup_recovery.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/startup_recovery.cpp b/src/mongo/db/startup_recovery.cpp
index 57546bd2bca..49207205bfe 100644
--- a/src/mongo/db/startup_recovery.cpp
+++ b/src/mongo/db/startup_recovery.cpp
@@ -164,8 +164,9 @@ Status buildMissingIdIndex(OperationContext* opCtx, Collection* collection) {
indexer.abortIndexBuild(opCtx, collWriter, MultiIndexBlock::kNoopOnCleanUpFn);
});
+ CollectionPtr collPtr(collection);
const auto indexCatalog = collection->getIndexCatalog();
- const auto idIndexSpec = indexCatalog->getDefaultIdIndexSpec(collection);
+ const auto idIndexSpec = indexCatalog->getDefaultIdIndexSpec(collPtr);
CollectionWriter collWriter(collection);
auto swSpecs = indexer.init(opCtx, collWriter, idIndexSpec, MultiIndexBlock::kNoopOnInitFn);
@@ -173,12 +174,12 @@ Status buildMissingIdIndex(OperationContext* opCtx, Collection* collection) {
return swSpecs.getStatus();
}
- auto status = indexer.insertAllDocumentsInCollection(opCtx, collection);
+ auto status = indexer.insertAllDocumentsInCollection(opCtx, collPtr);
if (!status.isOK()) {
return status;
}
- status = indexer.checkConstraints(opCtx, collection);
+ status = indexer.checkConstraints(opCtx, collPtr);
if (!status.isOK()) {
return status;
}