summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/repl_index_build_state.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/repl_index_build_state.cpp b/src/mongo/db/repl_index_build_state.cpp
index ecc932e9c96..4ca0a752686 100644
--- a/src/mongo/db/repl_index_build_state.cpp
+++ b/src/mongo/db/repl_index_build_state.cpp
@@ -311,6 +311,10 @@ ReplIndexBuildState::TryAbortResult ReplIndexBuildState::tryAbort(OperationConte
"buildUUID"_attr = buildUUID);
return TryAbortResult::kRetry;
}
+ if (_indexBuildState.isAborted()) {
+ // Returns if a concurrent operation already aborts the index build.
+ return TryAbortResult::kAlreadyAborted;
+ }
if (_waitForNextAction->getFuture().isReady()) {
const auto nextAction = _waitForNextAction->getFuture().get(opCtx);
invariant(nextAction == IndexBuildAction::kSinglePhaseCommit ||