summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/list_indexes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog/list_indexes.cpp')
-rw-r--r--src/mongo/db/catalog/list_indexes.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/mongo/db/catalog/list_indexes.cpp b/src/mongo/db/catalog/list_indexes.cpp
index 376d90ae9e4..c53f384bc0e 100644
--- a/src/mongo/db/catalog/list_indexes.cpp
+++ b/src/mongo/db/catalog/list_indexes.cpp
@@ -40,7 +40,6 @@
#include "mongo/db/db_raii.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/operation_context.h"
-#include "mongo/db/storage/durable_catalog.h"
#include "mongo/db/storage/storage_engine.h"
#include "mongo/util/uuid.h"
@@ -69,37 +68,29 @@ std::list<BSONObj> listIndexesInLock(OperationContext* opCtx,
boost::optional<bool> includeBuildUUIDs) {
invariant(opCtx->lockState()->isCollectionLockedForMode(nss, MODE_IS));
- auto durableCatalog = DurableCatalog::get(opCtx);
-
CurOpFailpointHelpers::waitWhileFailPointEnabled(
&hangBeforeListIndexes, opCtx, "hangBeforeListIndexes", []() {}, nss);
return writeConflictRetry(opCtx, "listIndexes", nss.ns(), [&] {
std::vector<std::string> indexNames;
std::list<BSONObj> indexSpecs;
- durableCatalog->getAllIndexes(opCtx, collection->getCatalogId(), &indexNames);
+ collection->getAllIndexes(&indexNames);
for (size_t i = 0; i < indexNames.size(); i++) {
- if (!includeBuildUUIDs.value_or(false) ||
- durableCatalog->isIndexReady(opCtx, collection->getCatalogId(), indexNames[i])) {
- indexSpecs.push_back(
- durableCatalog->getIndexSpec(opCtx, collection->getCatalogId(), indexNames[i]));
+ if (!includeBuildUUIDs.value_or(false) || collection->isIndexReady(indexNames[i])) {
+ indexSpecs.push_back(collection->getIndexSpec(indexNames[i]));
continue;
}
// The durable catalog will not have a build UUID for the given index name if it was
// not being built with two-phase.
- const auto durableBuildUUID = DurableCatalog::get(opCtx)->getIndexBuildUUID(
- opCtx, collection->getCatalogId(), indexNames[i]);
+ const auto durableBuildUUID = collection->getIndexBuildUUID(indexNames[i]);
if (!durableBuildUUID) {
- indexSpecs.push_back(
- durableCatalog->getIndexSpec(opCtx, collection->getCatalogId(), indexNames[i]));
+ indexSpecs.push_back(collection->getIndexSpec(indexNames[i]));
continue;
}
BSONObjBuilder builder;
- builder.append(
- "spec"_sd,
- durableCatalog->getIndexSpec(opCtx, collection->getCatalogId(), indexNames[i]));
+ builder.append("spec"_sd, collection->getIndexSpec(indexNames[i]));
durableBuildUUID->appendToBuilder(&builder, "buildUUID"_sd);
indexSpecs.push_back(builder.obj());
}