[SERVER-73266] Deadlock among createIndexes, index build commit, and step down Created: 24/Jan/23 Updated: 29/Oct/23 Resolved: 31/Jan/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.3.0-rc0, 6.0.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gregory Noma | Assignee: | Gregory Noma |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Storage Execution
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v6.0, v5.0
|
||||||||
| Sprint: | Execution Team 2023-02-06 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 136 | ||||||||
| Description |
|
In order to commit, an index build takes an X lock on its on its collection after explicitly unlocking the RSTL. Then a createIndexes command enqueues a collection IS lock (which implicitly takes the RSTL in IX) in order to check the TTL options on the command object. Now a step down occurs, enqueuing the RSTL in mode X. Now the index build attempts to take a collection IX lock on the config.system.indexBuilds collection, which first enqueues the RSTL in IX since it was previously unlocked. Thus a three-way deadlock has been reached. It seems the issue is that we should be waiting to re-acquire the RSTL until the subsequent timeout-retry logic. |
| Comments |
| Comment by Githook User [ 01/Feb/23 ] |
|
Author: {'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}Message: (cherry picked from commit 35370b26c155a89a540137fe168da98175a431bf) |
| Comment by Githook User [ 31/Jan/23 ] |
|
Author: {'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}Message: |