[SERVER-75308] Invariant failure involving a collection drop (external index build abort) racing with an internal index build abort Created: 27/Mar/23  Updated: 29/Oct/23  Resolved: 04/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Josef Ahmad Assignee: Josef Ahmad
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-76777 Deadlock between index build external... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2023-04-03, Execution Team 2023-04-17
Participants:
Linked BF Score: 135

 Description   
  1. Start an index build.
  2. Drop the underlying collection. The index build transitions to Status::kAborted.
  3. 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.


 Comments   
Comment by Githook User [ 04/Apr/23 ]

Author:

{'name': 'Josef Ahmad', 'email': 'josef.ahmad@mongodb.com', 'username': 'josefahmad'}

Message: SERVER-75308 Fix race between external and internal index build aborts
Branch: master
https://github.com/mongodb/mongo/commit/806b58d5fac1b17d848b3c7c997b67b68440b2ba

Generated at Thu Feb 08 06:29:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.