diff options
author | Yuhong Zhang <yuhong.zhang@mongodb.com> | 2022-10-18 03:38:52 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-18 14:13:00 +0000 |
commit | ee81d7f4b422edda8c5386c5d7b533736094106d (patch) | |
tree | e5fbf662e6ef3f01c59f6be3ab244b46e3acdf10 /src | |
parent | 313198e9fe2eb9aef4a202393d37496c42575664 (diff) | |
download | mongo-ee81d7f4b422edda8c5386c5d7b533736094106d.tar.gz |
SERVER-66776 Make ReplIndexBuildState::tryAbort() a no-op if a concurrent operation already aborts the index build
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/repl_index_build_state.cpp | 4 |
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 || |