diff options
author | Benety Goh <benety@mongodb.com> | 2021-06-16 07:04:59 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-16 11:26:18 +0000 |
commit | db7a7a0f167e97ac43415265f0f4bcec07dd2ca6 (patch) | |
tree | 6345e5fbc842151f85ff4484853e4ce46e538408 | |
parent | 0cc007969408affcec1e845261f83dcace27b579 (diff) | |
download | mongo-db7a7a0f167e97ac43415265f0f4bcec07dd2ca6.tar.gz |
SERVER-48524 indexbuildentryhelpers::removeIndexBuildEntry() uses DBHelpers::findById() instead of findOne()
This allows us to locate the index build in config.system.indexBuilds() using the _id_ index directly instead
of going through the query planner, which is still subject to interrupts.
-rw-r--r-- | src/mongo/db/index_build_entry_helpers.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/index_build_entry_helpers.cpp b/src/mongo/db/index_build_entry_helpers.cpp index a72482e00ab..0ed0831e060 100644 --- a/src/mongo/db/index_build_entry_helpers.cpp +++ b/src/mongo/db/index_build_entry_helpers.cpp @@ -261,10 +261,8 @@ Status removeIndexBuildEntry(OperationContext* opCtx, return Status(ErrorCodes::NamespaceNotFound, ss); } - RecordId rid = Helpers::findOne(opCtx, - collection.getCollection(), - BSON("_id" << indexBuildUUID), - /*requireIndex=*/true); + RecordId rid = + Helpers::findById(opCtx, collection.getCollection(), BSON("_id" << indexBuildUUID)); if (rid.isNull()) { str::stream ss; ss << "No matching IndexBuildEntry found with indexBuildUUID: " << indexBuildUUID; |