[SERVER-40952] Release the DB X lock in createIndexes after creating the collection/database Created: 01/May/19 Updated: 06/Dec/22 Resolved: 27/Nov/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Dianna Hohensee (Inactive) | Assignee: | Backlog - Storage Execution Team |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Storage Execution
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
First we take the DB lock in MODE_IX, then if the collection doesn't exist yet, we relock the DB in MODE_X in case we need to create the database as well for collection creation. However, we never relock the DB in MODE_IX after the collection is created. We end up holding the MODE_X for the duration of the createIndexes cmd in this scenario. Need to change it to relock in MODE_IX afterwards in both the runCreateIndexes function runCreateIndexesWithCoordinator function. |
| Comments |
| Comment by Maria van Keulen [ 27/Nov/19 ] |
|
The work for |
| Comment by Dianna Hohensee (Inactive) [ 03/May/19 ] |
|
We will have to be careful to create the collection before testing concurrent index builds. I tried pausing an index build via failpoint and parallel shell, then ran a second request: the second request hung earlier than anticipated because the first build request was holding a X lock instead of an IX. Maybe it isn't a common test paradigm, at the moment. |