- Start an index build.
- Drop the underlying collection. The index build transitions to Status::kAborted.
- Concurrent with 2, while still ongoing, the index build detects an error (e.g. invalid geo value) and attempts to transition to State::kAwaitPrimaryAbort. This transition is not allowed, and the mongod fails this invariant.
I believe this scenario only applies when featureFlagIndexBuildGracefulErrorHandling is on.
Some options:
- Allow a transition from kAborted or kAwaitPrimaryAbort. This seems unlikely, as most of the index build context may be gone by the time we're in kAborted state.
- Interpret a transition to kAwaitPrimaryAbort state as "nothing else to do" if we're already in kAbort.
- Make external aborts go through the kAwaitPrimaryAbort state, that is, through the voteAbortIndexBuild path.
|