[SERVER-48062] Index build abort can race with stepdown Created: 08/May/20  Updated: 29/Oct/23  Resolved: 02/Jun/20

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

Type: Bug Priority: Major - P3
Reporter: Louis Williams 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
Related
related to SERVER-79176 Index build _completeExternalAbort sh... Closed
related to SERVER-48524 Acquire config.system.indexBuilds loc... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-06-15
Participants:
Linked BF Score: 20

 Description   

The contract for aborting an index build is that once the aborting thread acquires the RSTL, the collection X lock, and kills the builder thread, it must follow-through with the abort by writing an "abortIndexBuild" oplog entry. Otherwise, the index build is left unfinished on disk with no means of making progress.

In a special race, a step-down can interrupt the final write, after the RSTL has been acquired, causing the server to crash.

We should consider making this critical section resilient to being interrupted.



 Comments   
Comment by Githook User [ 02/Jun/20 ]

Author:

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

Message: SERVER-48062 Index build abort should not be interrupted by stepdown

(cherry picked from commit baf75dd579bfec6554fa881b73cc427f0bbb3309)
Branch: v4.4
https://github.com/mongodb/mongo/commit/41dac937f818a5d10977347cae5884bac4a10a74

Comment by Githook User [ 02/Jun/20 ]

Author:

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

Message: SERVER-48062 Index build abort should not be interrupted by stepdown
Branch: master
https://github.com/mongodb/mongo/commit/baf75dd579bfec6554fa881b73cc427f0bbb3309

Generated at Thu Feb 08 05:16:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.