diff options
author | Fausto J Leyva <fausto.leyva@mongodb.com> | 2022-03-11 15:36:35 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-11 16:36:51 +0000 |
commit | db3d5680e8624326d902c9c1b51ce82e2f0a94d2 (patch) | |
tree | da620856ad99f09447fc0c6b7c650be8d18dcf17 | |
parent | e146ca34cbec7301ba1be1cc3c10c56a53a107fc (diff) | |
download | mongo-db3d5680e8624326d902c9c1b51ce82e2f0a94d2.tar.gz |
SERVER-61786 Determine if we can avoid global lock upgrade in IndexBuildsCoordinatorMongod::setCommitQuorum
-rw-r--r-- | src/mongo/db/index_builds_coordinator_mongod.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/index_builds_coordinator_mongod.cpp b/src/mongo/db/index_builds_coordinator_mongod.cpp index 4232817b409..233e9df2fa1 100644 --- a/src/mongo/db/index_builds_coordinator_mongod.cpp +++ b/src/mongo/db/index_builds_coordinator_mongod.cpp @@ -777,7 +777,9 @@ Status IndexBuildsCoordinatorMongod::setCommitQuorum(OperationContext* opCtx, << nss << "' without providing any indexes."); } - AutoGetCollectionForRead collection(opCtx, nss); + // Take the MODE_IX lock now, so that when we actually persist the value later, we don't need to + // upgrade the lock. + AutoGetCollection collection(opCtx, nss, MODE_IX); if (!collection) { return Status(ErrorCodes::NamespaceNotFound, str::stream() << "Collection '" << nss << "' was not found."); |