diff options
author | Benety Goh <benety@mongodb.com> | 2020-08-24 15:51:07 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-24 22:13:54 +0000 |
commit | fdc21c767f1ba1ccd8d69f5bb5e2561e8d5c22c3 (patch) | |
tree | 5645d9b153f093d7ec69552a5ab4a56d746abd90 /src/mongo/db/index_builds_coordinator.cpp | |
parent | 118c3fad1141230435881a92865025b863376697 (diff) | |
download | mongo-fdc21c767f1ba1ccd8d69f5bb5e2561e8d5c22c3.tar.gz |
SERVER-50446 IndexBuildsCoordinator provides 'isResumable' info to MultiIndexBuild when stopping index builds for rollback/shutdown
Diffstat (limited to 'src/mongo/db/index_builds_coordinator.cpp')
-rw-r--r-- | src/mongo/db/index_builds_coordinator.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp index dc6687a95a9..e329924d2d0 100644 --- a/src/mongo/db/index_builds_coordinator.cpp +++ b/src/mongo/db/index_builds_coordinator.cpp @@ -1333,8 +1333,9 @@ void IndexBuildsCoordinator::_completeAbort(OperationContext* opCtx, case IndexBuildAction::kRollbackAbort: { invariant(replState->protocol == IndexBuildProtocol::kTwoPhase); invariant(replCoord->getMemberState().rollback()); + auto isResumable = !replState->lastOpTimeBeforeInterceptors.isNull(); _indexBuildsManager.abortIndexBuildWithoutCleanupForRollback( - opCtx, coll, replState->buildUUID); + opCtx, coll, replState->buildUUID, isResumable); break; } case IndexBuildAction::kNoAction: @@ -1367,8 +1368,9 @@ void IndexBuildsCoordinator::_completeAbortForShutdown( std::shared_ptr<ReplIndexBuildState> replState, Collection* collection) { // Leave it as-if kill -9 happened. Startup recovery will restart the index build. + auto isResumable = !replState->lastOpTimeBeforeInterceptors.isNull(); _indexBuildsManager.abortIndexBuildWithoutCleanupForShutdown( - opCtx, collection, replState->buildUUID); + opCtx, collection, replState->buildUUID, isResumable); { // Promise should be set at least once before it's getting destroyed. |