[SERVER-46560] Make Abort index build logic deterministic. Created: 03/Mar/20  Updated: 29/Oct/23  Resolved: 10/Apr/20

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.4.0-rc2, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-45916 On primary, 2-phase index build clean... Closed
is depended on by SERVER-46823 Enable default for index commit quoru... Closed
is depended on by SERVER-47163 Do not start an index build if it doe... Closed
Duplicate
is duplicated by SERVER-45921 Index builder invariants on this chec... Closed
is duplicated by SERVER-46816 Race between oplog applier thread and... Closed
is duplicated by SERVER-44791 Abort index builds by interrupting th... Closed
Problem/Incident
Related
related to SERVER-47087 Stepping down the primary when runnin... Closed
related to SERVER-48293 remove inactive index builds from con... Closed
related to SERVER-50105 Coverity analysis defect 115661: Unch... Closed
related to SERVER-51255 rollback persists resumable index inf... Closed
related to SERVER-48510 StorageTimestampTests::TimestampIndex... Closed
related to SERVER-48160 remove IndexBuildsCoordinator::_tryAb... Closed
is related to SERVER-45921 Index builder invariants on this chec... Closed
is related to SERVER-46734 Disable the index state transition ch... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-03-23, Execution Team 2020-04-06, Execution Team 2020-04-20
Participants:
Linked BF Score: 42

 Description   

Index build started on primary could either abort without aborting the inde



 Comments   
Comment by Githook User [ 15/Apr/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-46560 Make abort index build deterministic

This redesigns user index build abort to have the following behavior:

  • Take a collection X lock to stop the index build from making progress
  • If we are no longer primary, return an error
  • Check whether we can abort the index build (i.e. it is not already committing
    or aborting)
  • Delete the index catalog entry and write the abortIndexBuild oplog entry in a WUOW
  • Interrupt the index builder thread
  • Wait for the thread to exit
  • Release locks

(cherry picked from commit 3d929ed533a72446353b18b5d60770aed33b58f1)
Branch: v4.4
https://github.com/mongodb/mongo/commit/25e77386e7252a3c60c02954bb97a6b1b21247f5

Comment by Githook User [ 10/Apr/20 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-46560 Make abort index build deterministic

This redesigns user index build abort to have the following behavior:

  • Take a collection X lock to stop the index build from making progress
  • If we are no longer primary, return an error
  • Check whether we can abort the index build (i.e. it is not already committing
    or aborting)
  • Delete the index catalog entry and write the abortIndexBuild oplog entry in a WUOW
  • Interrupt the index builder thread
  • Wait for the thread to exit
  • Release locks
    Branch: master
    https://github.com/mongodb/mongo/commit/3d929ed533a72446353b18b5d60770aed33b58f1
Generated at Thu Feb 08 05:11:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.