[SERVER-59074] Do not acquire storage tickets just to set/wait on oplog visibility Created: 03/Aug/21 Updated: 29/Oct/23 Resolved: 10/Aug/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.2.16, 4.0.27, 4.4.10, 5.0.4, 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Gregory Wlodarek |
| Resolution: | Fixed | Votes: | 2 |
| 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: |
v5.0, v4.4, v4.2, v4.0
|
||||||||||||
| Sprint: | Execution Team 2021-08-09, Execution Team 2021-08-23 | ||||||||||||
| Participants: | |||||||||||||
| Case: | (copied to CRM) | ||||||||||||
| Description |
|
When we wait on oplog visibility with waitForAllEarlierOplogWritesToBeVisible, and when we set oplog visibility with oplogDiskLocRegister, we acquire a global lock, which automatically takes a storage read ticket. Together, doing both can result in a deadlock. Just having waitForAllEarlierOplogWritesToBeVisible take a ticket can result on local reads blocking behind reads with a read concern that's waiting for oplog writes. Since neither operation affects the resources protected by read tickets, we should use skipAcquireTicket() when acquiring these locks. (We may need an RAII type to set/restore that flag) |
| Comments |
| Comment by Githook User [ 20/Sep/21 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: (cherry picked from commit 64dd4524434f617b480e742e8dc421cccd8231fa) |
| Comment by Githook User [ 17/Sep/21 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: (cherry picked from commit 0dd96157fb1fffc8eefe6be4b26aff9805bfbfac) |
| Comment by Githook User [ 17/Sep/21 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: (cherry picked from commit 64dd4524434f617b480e742e8dc421cccd8231fai) |
| Comment by Githook User [ 25/Aug/21 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: (cherry picked from commit 64dd4524434f617b480e742e8dc421cccd8231fai) |
| Comment by Githook User [ 25/Aug/21 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: (cherry picked from commit 64dd4524434f617b480e742e8dc421cccd8231fai) |
| Comment by Githook User [ 20/Aug/21 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: (cherry picked from commit 64dd4524434f617b480e742e8dc421cccd8231fai) |