summaryrefslogtreecommitdiff
path: root/src/mongo/db/repair_database.cpp
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2019-11-06 16:24:40 +0000
committerevergreen <evergreen@mongodb.com>2019-11-06 16:24:40 +0000
commit39c08aceaf7fa15a8e65cf80b09863b452425426 (patch)
tree7efc9eab66c71f8894c7ebf6dee8b0ee649dec18 /src/mongo/db/repair_database.cpp
parent0ff5e5e7cc09c31d3fe260cf6602f461e6e20bb6 (diff)
downloadmongo-39c08aceaf7fa15a8e65cf80b09863b452425426.tar.gz
SERVER-44276: Change storage engine catalog map to be keyed by RecordId instead of Namespace.
Diffstat (limited to 'src/mongo/db/repair_database.cpp')
-rw-r--r--src/mongo/db/repair_database.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/db/repair_database.cpp b/src/mongo/db/repair_database.cpp
index 092857b8a81..19e5a8fe114 100644
--- a/src/mongo/db/repair_database.cpp
+++ b/src/mongo/db/repair_database.cpp
@@ -61,7 +61,7 @@
namespace mongo {
StatusWith<IndexNameObjs> getIndexNameObjs(OperationContext* opCtx,
- const NamespaceString& nss,
+ RecordId catalogId,
std::function<bool(const std::string&)> filter) {
IndexNameObjs ret;
std::vector<std::string>& indexNames = ret.first;
@@ -69,7 +69,7 @@ StatusWith<IndexNameObjs> getIndexNameObjs(OperationContext* opCtx,
auto durableCatalog = DurableCatalog::get(opCtx);
{
// Fetch all indexes
- durableCatalog->getAllIndexes(opCtx, nss, &indexNames);
+ durableCatalog->getAllIndexes(opCtx, catalogId, &indexNames);
auto newEnd =
std::remove_if(indexNames.begin(),
indexNames.end(),
@@ -80,7 +80,7 @@ StatusWith<IndexNameObjs> getIndexNameObjs(OperationContext* opCtx,
for (const auto& name : indexNames) {
- BSONObj spec = durableCatalog->getIndexSpec(opCtx, nss, name);
+ BSONObj spec = durableCatalog->getIndexSpec(opCtx, catalogId, name);
using IndexVersion = IndexDescriptor::IndexVersion;
IndexVersion indexVersion = IndexVersion::kV1;
if (auto indexVersionElem = spec[IndexDescriptor::kIndexVersionFieldName]) {
@@ -147,7 +147,8 @@ Status repairCollections(OperationContext* opCtx,
log() << "Repairing collection " << nss;
- Status status = engine->repairRecordStore(opCtx, nss);
+ auto collection = CollectionCatalog::get(opCtx).lookupCollectionByNamespace(nss);
+ Status status = engine->repairRecordStore(opCtx, collection->getCatalogId(), nss);
if (!status.isOK())
return status;
}
@@ -155,7 +156,7 @@ Status repairCollections(OperationContext* opCtx,
for (const auto& nss : colls) {
opCtx->checkForInterrupt();
auto collection = CollectionCatalog::get(opCtx).lookupCollectionByNamespace(nss);
- auto swIndexNameObjs = getIndexNameObjs(opCtx, nss);
+ auto swIndexNameObjs = getIndexNameObjs(opCtx, collection->getCatalogId());
if (!swIndexNameObjs.isOK())
return swIndexNameObjs.getStatus();