summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_builds_coordinator.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-08-24 15:51:07 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-24 22:13:54 +0000
commitfdc21c767f1ba1ccd8d69f5bb5e2561e8d5c22c3 (patch)
tree5645d9b153f093d7ec69552a5ab4a56d746abd90 /src/mongo/db/index_builds_coordinator.cpp
parent118c3fad1141230435881a92865025b863376697 (diff)
downloadmongo-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.cpp6
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.