diff options
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/drop_indexes.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/commands/list_collections.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/commands/list_indexes.cpp | 11 | ||||
-rw-r--r-- | src/mongo/db/commands/mr.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/commands/resize_oplog.cpp | 2 |
5 files changed, 16 insertions, 10 deletions
diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp index 9c6e5394797..033023ec710 100644 --- a/src/mongo/db/commands/drop_indexes.cpp +++ b/src/mongo/db/commands/drop_indexes.cpp @@ -151,7 +151,8 @@ public: vector<string> indexNames; writeConflictRetry(opCtx, "listIndexes", toReIndexNss.ns(), [&] { indexNames.clear(); - DurableCatalog::get(opCtx)->getAllIndexes(opCtx, collection->ns(), &indexNames); + DurableCatalog::get(opCtx)->getAllIndexes( + opCtx, collection->getCatalogId(), &indexNames); }); all.reserve(indexNames.size()); @@ -159,7 +160,8 @@ public: for (size_t i = 0; i < indexNames.size(); i++) { const string& name = indexNames[i]; BSONObj spec = writeConflictRetry(opCtx, "getIndexSpec", toReIndexNss.ns(), [&] { - return DurableCatalog::get(opCtx)->getIndexSpec(opCtx, collection->ns(), name); + return DurableCatalog::get(opCtx)->getIndexSpec( + opCtx, collection->getCatalogId(), name); }); { diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index 398c4f4fb36..ca0dab0d375 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -186,7 +186,8 @@ BSONObj buildCollectionBson(OperationContext* opCtx, return b.obj(); } - CollectionOptions options = DurableCatalog::get(opCtx)->getCollectionOptions(opCtx, nss); + CollectionOptions options = + DurableCatalog::get(opCtx)->getCollectionOptions(opCtx, collection->getCatalogId()); // While the UUID is stored as a collection option, from the user's perspective it is an // unsettable read-only property, so put it in the 'info' section. diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp index b7c26eb3309..858b22daba0 100644 --- a/src/mongo/db/commands/list_indexes.cpp +++ b/src/mongo/db/commands/list_indexes.cpp @@ -164,7 +164,7 @@ public: vector<string> indexNames; writeConflictRetry(opCtx, "listIndexes", nss.ns(), [&] { indexNames.clear(); - durableCatalog->getAllIndexes(opCtx, nss, &indexNames); + durableCatalog->getAllIndexes(opCtx, collection->getCatalogId(), &indexNames); }); auto ws = std::make_unique<WorkingSet>(); @@ -173,17 +173,20 @@ public: for (size_t i = 0; i < indexNames.size(); i++) { auto indexSpec = writeConflictRetry(opCtx, "listIndexes", nss.ns(), [&] { if (includeBuildUUIDs && - !durableCatalog->isIndexReady(opCtx, nss, indexNames[i])) { + !durableCatalog->isIndexReady( + opCtx, collection->getCatalogId(), indexNames[i])) { BSONObjBuilder builder; builder.append("spec"_sd, - durableCatalog->getIndexSpec(opCtx, nss, indexNames[i])); + durableCatalog->getIndexSpec( + opCtx, collection->getCatalogId(), indexNames[i])); // TODO(SERVER-37980): Replace with index build UUID. auto indexBuildUUID = UUID::gen(); indexBuildUUID.appendToBuilder(&builder, "buildUUID"_sd); return builder.obj(); } - return durableCatalog->getIndexSpec(opCtx, nss, indexNames[i]); + return durableCatalog->getIndexSpec( + opCtx, collection->getCatalogId(), indexNames[i]); }); WorkingSetID id = ws->allocate(); diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index f9f1ced56da..f7bc154dfb8 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -560,8 +560,8 @@ void State::prepTempCollection() { auto const finalColl = autoGetFinalColl.getCollection(); if (finalColl) { - finalOptions = - DurableCatalog::get(_opCtx)->getCollectionOptions(_opCtx, finalColl->ns()); + finalOptions = DurableCatalog::get(_opCtx)->getCollectionOptions( + _opCtx, finalColl->getCatalogId()); std::unique_ptr<IndexCatalog::IndexIterator> ii = finalColl->getIndexCatalog()->getIndexIterator(_opCtx, true); diff --git a/src/mongo/db/commands/resize_oplog.cpp b/src/mongo/db/commands/resize_oplog.cpp index 2cd5f851cb4..31c2153a8da 100644 --- a/src/mongo/db/commands/resize_oplog.cpp +++ b/src/mongo/db/commands/resize_oplog.cpp @@ -105,7 +105,7 @@ public: WriteUnitOfWork wunit(opCtx); Status status = coll->getRecordStore()->updateCappedSize(opCtx, size); uassertStatusOK(status); - DurableCatalog::get(opCtx)->updateCappedSize(opCtx, coll->ns(), size); + DurableCatalog::get(opCtx)->updateCappedSize(opCtx, coll->getCatalogId(), size); wunit.commit(); LOG(0) << "replSetResizeOplog success, currentSize:" << size; return true; |