[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:
Duplicate
duplicates SERVER-44405 Use MODE_IX lock for implicit collect... Closed
Related
related to SERVER-44877 Complete TODO listed in SERVER-40952 Closed
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 SERVER-44405 includes removing the MODE_X collection lock acquisition (the MODE_X db lock was removed inĀ SERVER-43858) when createIndexes implicitly creates a collection.

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.

Generated at Thu Feb 08 04:56:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.