summaryrefslogtreecommitdiff
path: root/src/mongo/db/system_index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/system_index.cpp')
-rw-r--r--src/mongo/db/system_index.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/mongo/db/system_index.cpp b/src/mongo/db/system_index.cpp
index 653d9f286e7..2283e75c9d6 100644
--- a/src/mongo/db/system_index.cpp
+++ b/src/mongo/db/system_index.cpp
@@ -43,7 +43,6 @@
#include "mongo/db/catalog/index_key_validate.h"
#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/db_raii.h"
-#include "mongo/db/exec/scoped_timer.h"
#include "mongo/db/index/index_descriptor.h"
#include "mongo/db/index_builds_coordinator.h"
#include "mongo/db/jsobj.h"
@@ -129,7 +128,7 @@ void generateSystemIndexForExistingCollection(OperationContext* opCtx,
} // namespace
-Status verifySystemIndexes(OperationContext* opCtx, BSONObjBuilder* startupTimeElapsedBuilder) {
+Status verifySystemIndexes(OperationContext* opCtx) {
// Do not try and generate any system indexes in read only mode.
if (storageGlobalParams.readOnly) {
LOGV2_WARNING(22489,
@@ -145,17 +144,12 @@ Status verifySystemIndexes(OperationContext* opCtx, BSONObjBuilder* startupTimeE
AutoGetCollection collection(opCtx, systemUsers, MODE_X);
if (collection) {
- auto scopedTimer = createTimeElapsedBuilderScopedTimer(
- opCtx->getServiceContext()->getFastClockSource(),
- "Verify indexes for admin.system.users collection",
- startupTimeElapsedBuilder);
const IndexCatalog* indexCatalog = collection->getIndexCatalog();
invariant(indexCatalog);
// Make sure the old unique index from v2.4 on system.users doesn't exist.
std::vector<const IndexDescriptor*> indexes;
- indexCatalog->findIndexesByKeyPattern(
- opCtx, v1SystemUsersKeyPattern, IndexCatalog::InclusionPolicy::kReady, &indexes);
+ indexCatalog->findIndexesByKeyPattern(opCtx, v1SystemUsersKeyPattern, false, &indexes);
if (!indexes.empty()) {
fassert(ErrorCodes::AmbiguousIndexKeyPattern, indexes.size() == 1);
@@ -166,8 +160,7 @@ Status verifySystemIndexes(OperationContext* opCtx, BSONObjBuilder* startupTimeE
}
// Ensure that system indexes exist for the user collection.
- indexCatalog->findIndexesByKeyPattern(
- opCtx, v3SystemUsersKeyPattern, IndexCatalog::InclusionPolicy::kReady, &indexes);
+ indexCatalog->findIndexesByKeyPattern(opCtx, v3SystemUsersKeyPattern, false, &indexes);
if (indexes.empty()) {
try {
generateSystemIndexForExistingCollection(
@@ -185,16 +178,11 @@ Status verifySystemIndexes(OperationContext* opCtx, BSONObjBuilder* startupTimeE
// Ensure that system indexes exist for the roles collection, if it exists.
if (collection) {
- auto scopedTimer = createTimeElapsedBuilderScopedTimer(
- opCtx->getServiceContext()->getFastClockSource(),
- "Verify indexes for admin.system.roles collection",
- startupTimeElapsedBuilder);
const IndexCatalog* indexCatalog = collection->getIndexCatalog();
invariant(indexCatalog);
std::vector<const IndexDescriptor*> indexes;
- indexCatalog->findIndexesByKeyPattern(
- opCtx, v3SystemRolesKeyPattern, IndexCatalog::InclusionPolicy::kReady, &indexes);
+ indexCatalog->findIndexesByKeyPattern(opCtx, v3SystemRolesKeyPattern, false, &indexes);
if (indexes.empty()) {
try {
generateSystemIndexForExistingCollection(