[SERVER-41014] runCreateIndexesWithCoordinator does not correctly relock the database Created: 04/May/19  Updated: 29/Oct/23  Resolved: 04/Jun/19

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 4.2.0-rc3, 4.3.1

Type: Bug Priority: Major - P3
Reporter: Geert Bosch Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-41141 Remove DB X lock acquisition for seco... Closed
is related to SERVER-41021 createIndexes should not use Database... Closed
is related to SERVER-39369 Filter index builds requests in the c... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Storage NYC 2019-05-20, Execution Team 2019-06-03, Execution Team 2019-06-17
Participants:
Linked BF Score: 0

 Description   

At the beginning of this code in runCreateIndexesWithCoordinator, a collection lock is acquired in MODE_IX using AutoGetCollection. This also locks the database in MODE_IX, but this lock is not yielded before trying to relock the database with MODE_X. This results in a conversion of the database lock instead of a relock, potentially resulting in deadlock.



 Comments   
Comment by Githook User [ 29/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41014 fix deadlock in runCreateIndexesWithCoordinator()

(cherry picked from commit f6e5ad7fe565d291f7333966b5f0355e7c06650a)
Branch: v4.2
https://github.com/mongodb/mongo/commit/2ab86773334aa6cedbe9609c06a0f538cd39cede

Comment by Githook User [ 29/Jun/19 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-41014 runCreateIndexesWithCoordinator() uses helper functions extracted from runCreateIndexes()

(cherry picked from commit 0a17878018fb5d14d8eff2f2c12b3aa7c4d21958)
Branch: v4.2
https://github.com/mongodb/mongo/commit/e6513a6b1d45045f735f207ea78f35efaac7967e

Comment by Githook User [ 29/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41014 extract helper functions from runCreateIndexes()

(cherry picked from commit 47ca83f447f651fa757d995bc65638d7599e1e5a)
Branch: v4.2
https://github.com/mongodb/mongo/commit/6efb45d403f69799574c48698b13a03cad4fca74

Comment by Githook User [ 04/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: Revert "SERVER-41014 extract helper functions from runCreateIndexes()"

This reverts commit 47ca83f447f651fa757d995bc65638d7599e1e5a.
Branch: v4.2
https://github.com/mongodb/mongo/commit/777d16318b500ffab9a9ff19e639f5dc08e1c1b2

Comment by Githook User [ 04/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41014 fix deadlock in runCreateIndexesWithCoordinator()
Branch: master
https://github.com/mongodb/mongo/commit/f6e5ad7fe565d291f7333966b5f0355e7c06650a

Comment by Githook User [ 03/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41014 runCreateIndexesWithCoordinator() uses helper functions extracted from runCreateIndexes()
Branch: master
https://github.com/mongodb/mongo/commit/0a17878018fb5d14d8eff2f2c12b3aa7c4d21958

Comment by Githook User [ 03/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41014 extract helper functions from runCreateIndexes()
Branch: master
https://github.com/mongodb/mongo/commit/47ca83f447f651fa757d995bc65638d7599e1e5a

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