diff options
author | Benety Goh <benety@mongodb.com> | 2019-11-07 16:29:49 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-11-07 16:29:49 +0000 |
commit | 15485ce91b20c2eaf8ec7bc4c74e26fc58ebaf86 (patch) | |
tree | 8dc6f2ab268f277f89a650f9889948f61f65f6ec | |
parent | b2493375543cb89b020f224a1759c1f4d40aa638 (diff) | |
download | mongo-15485ce91b20c2eaf8ec7bc4c74e26fc58ebaf86.tar.gz |
SERVER-44436 IndexBuildsCoordinatorMongod always uses thread pool to run index build
-rw-r--r-- | src/mongo/db/index_builds_coordinator_mongod.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/mongo/db/index_builds_coordinator_mongod.cpp b/src/mongo/db/index_builds_coordinator_mongod.cpp index ab382899123..99cdc6b6ca1 100644 --- a/src/mongo/db/index_builds_coordinator_mongod.cpp +++ b/src/mongo/db/index_builds_coordinator_mongod.cpp @@ -112,17 +112,7 @@ IndexBuildsCoordinatorMongod::startIndexBuild(OperationContext* opCtx, auto replState = invariant(_getIndexBuild(buildUUID)); - // Run index build in-line if we are transitioning between replication modes. - // While the RSTLExclusive is being held, an async thread in the thread pool would not be - // allowed to take locks. - if (opCtx->lockState()->isRSTLExclusive()) { - log() << "Running index build on current thread because we are transitioning between " - "replication states: " - << buildUUID; - // Sets up and runs the index build. Sets result and cleans up index build. - _runIndexBuild(opCtx, buildUUID, indexBuildOptions); - return replState->sharedPromise.getFuture(); - } + invariant(!opCtx->lockState()->isRSTLExclusive(), buildUUID.toString()); // Copy over all necessary OperationContext state. |