diff options
author | Jordi Olivares Provencio <jordi.olivares-provencio@mongodb.com> | 2022-09-20 13:18:37 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-20 13:49:22 +0000 |
commit | 152ae38f2295f8f7996430ca119c8b861d55c303 (patch) | |
tree | 851bdcc6a81c6f6755a8c215975bf13456629e78 /src/mongo/db/index_builds_coordinator.cpp | |
parent | bdeb7d80139abd91d3db4eaa29df796375096ec4 (diff) | |
download | mongo-152ae38f2295f8f7996430ca119c8b861d55c303.tar.gz |
SERVER-69530 Skip sharding DB check during index builds
Diffstat (limited to 'src/mongo/db/index_builds_coordinator.cpp')
-rw-r--r-- | src/mongo/db/index_builds_coordinator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp index d4307107cb2..0342d563301 100644 --- a/src/mongo/db/index_builds_coordinator.cpp +++ b/src/mongo/db/index_builds_coordinator.cpp @@ -2718,7 +2718,11 @@ IndexBuildsCoordinator::CommitResult IndexBuildsCoordinator::_insertKeysFromSide hangIndexBuildBeforeCommit.pauseWhileSet(); } - AutoGetDb autoDb(opCtx, replState->dbName, MODE_IX); + // Skip the check for sharding's critical section check as it can only be acquired during a + // `movePrimary` or drop database operations. The only operation that would affect the index + // build is when the collection's data needs to get modified, but the only modification possible + // is to delete the entire collection, which will cause the index to be dropped. + Lock::DBLock dbLock(opCtx, replState->dbName, MODE_IX); // Unlock RSTL to avoid deadlocks with prepare conflicts and state transitions caused by waiting // for a a strong collection lock. See SERVER-42621. |