[SERVER-41141] Remove DB X lock acquisition for secondary index builds Created: 14/May/19 Updated: 29/Oct/23 Resolved: 10/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.2.0-rc1, 4.3.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Gregory Wlodarek |
| 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.2
|
||||||||||||||||||||||||||||
| Sprint: | Execution Team 2019-06-03, Execution Team 2019-06-17 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||||||
| Description |
|
The IndexBuildsCoordinator, which builds background indexes on secondaries, still takes a Database X lock, despite changes made on primaries to take a Collection X lock. Secondaries should take the same locks as primaries, which could otherwise lead to unexpected deadlocks. |
| Comments |
| Comment by Githook User [ 10/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |
| Comment by Githook User [ 10/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |
| Comment by Gregory Wlodarek [ 07/Jun/19 ] |
|
Unfortunately the codepath that rebuilds system indexes on startup for mobile uses the IndexBuildsCoordinator causing BF-13526 (hitting our isBackground invariant). Reverting for now until a solution for that is proposed. |
| Comment by Githook User [ 07/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: Revert " This reverts commit fd2f851f6ce482064063286a6c763cf4dc2c4198. |
| Comment by Githook User [ 07/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: Revert " This reverts commit 0c9d0e18109314efac6aa9f5352992cd4afc4d96. |
| Comment by Githook User [ 06/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |
| Comment by Githook User [ 06/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |
| Comment by Githook User [ 06/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |
| Comment by Githook User [ 06/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |
| Comment by Gregory Wlodarek [ 03/Jun/19 ] |
|
benety.goh, you're right, I marked |
| Comment by Githook User [ 03/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: Revert " This reverts commit 99185ab9685a51466e56ef0fd862aaf1318a79d6. |
| Comment by Githook User [ 03/Jun/19 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |
| Comment by Benety Goh [ 01/Jun/19 ] |
|
One of the proposed solutions for this ticket, currently in review, downgrades the exclusive lock in IndexBuildsCoordinator::_runIndexBuildInner() to an intent lock. This may affect the removal of temporary record stores created by hybrid index builds during a clean shutdown. This behavior is best characterized by the JS test jstests/noPassthrough/indexbg_shutdown.js.
|