[SERVER-46989] Index builds should hold RSTL to prevent replication state changes after deciding to commit or abort Created: 19/Mar/20 Updated: 29/Oct/23 Resolved: 17/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: |
|
||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||||||||||||||||||||||||||
| Sprint: | Execution Team 2020-04-20, Execution Team 2020-05-04 | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 48 | ||||||||||||||||||||||||||||||||||||
| Description |
|
IndexBuildsCoordinatorMongod::_waitForNextIndexBuildAction() holds RSTL only for the while loop scope to perform primary check. Because of that, the primary check is no longer valid after this point. This can lead stepped down node(secondary) trying to commit or abort without getting commit/abortIndex oplog entry for 2 phase index builds. In turn, it results in this invariant failure.
|
| Comments |
| Comment by Githook User [ 20/Apr/20 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: This also elminates deadlocks caused by an index builder holding an RSTL (cherry picked from commit fca4421ffab68ae0b62c36a7505e6045428ce2e5) |
| Comment by Githook User [ 17/Apr/20 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: This also elminates deadlocks caused by an index builder holding an RSTL |
| Comment by Louis Williams [ 15/Apr/20 ] |
|
Code review: https://mongodbcr.appspot.com/584760001/ |
| Comment by Suganthi Mani [ 19/Mar/20 ] |
|
I feel, we should also address this |