diff options
author | Louis Williams <louis.williams@mongodb.com> | 2020-03-03 16:15:23 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-10 18:03:42 +0000 |
commit | 2fd22e51e07c93a78a67cbb8d01289b96cb7f60a (patch) | |
tree | dfba42ee14bdfd2a0a480ddb152a4970df29fa65 /src/mongo/db/repl_index_build_state.h | |
parent | f042509f1c46e292cc14af7c7ba23b9cc97c5185 (diff) | |
download | mongo-2fd22e51e07c93a78a67cbb8d01289b96cb7f60a.tar.gz |
SERVER-46397 Only report an index build as aborted if it is currently aborting, not committing
This expands the concurrency control features used by two-phase index
builds to standalone nodes and single-phase index builds so that
concurrent commits and aborts behave correctly.
Diffstat (limited to 'src/mongo/db/repl_index_build_state.h')
-rw-r--r-- | src/mongo/db/repl_index_build_state.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/db/repl_index_build_state.h b/src/mongo/db/repl_index_build_state.h index 816eb4a7c11..5bd3552ffb5 100644 --- a/src/mongo/db/repl_index_build_state.h +++ b/src/mongo/db/repl_index_build_state.h @@ -84,6 +84,10 @@ enum class IndexBuildAction { */ kPrimaryAbort, /** + * Commit signal set by an index build on a secondary for a single-phase build. + */ + kSinglePhaseSecondaryCommit, + /** * Commit signal set by "voteCommitIndexBuild" cmd and step up. */ kCommitQuorumSatisfied @@ -230,9 +234,7 @@ struct ReplIndexBuildState { indexSpecs(specs), protocol(protocol), commitQuorum(commitQuorum) { - if (IndexBuildProtocol::kTwoPhase == protocol) { - waitForNextAction = std::make_unique<SharedPromise<IndexBuildAction>>(); - } + waitForNextAction = std::make_unique<SharedPromise<IndexBuildAction>>(); } // Uniquely identifies this index build across replica set members. |