[SERVER-70338] Query yield accesses the storage engine without locks during shutdown and rollback Created: 07/Oct/22 Updated: 13/Dec/23 Resolved: 25/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0, 7.0.5, 6.0.13 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Louis Williams |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Assigned Teams: |
Storage Execution
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||
| Backport Requested: |
v7.0, v6.0, v5.0, v4.4
|
||||||||||||||||||||||||||||
| Sprint: | Execution Team 2022-11-14, Execution Team 2023-04-03, Execution Team 2023-04-17, Execution Team 2023-05-01 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Linked BF Score: | 103 | ||||||||||||||||||||||||||||
| Description |
|
The yielding code in PlanYieldPolicy does the following:
The global lock synchronizes access to the storage engine for shutdown and rollback. This order of operations can result in the operation unsafely accessing the storage engine during these periods. This has existed since at least 3.6. |
| Comments |
| Comment by Githook User [ 13/Dec/23 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message:
(cherry picked from commit 55877fcfb5e8ac0b23f65862cd1d2f9b439c07f6) GitOrigin-RevId: 5ef84cf4a6616131694bc4c269d83c05fd570648 |
| Comment by Githook User [ 11/Dec/23 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message:
(cherry picked from commit 55877fcfb5e8ac0b23f65862cd1d2f9b439c07f6) GitOrigin-RevId: 1854bf2ace299e22995bf8d7e64195107f703029 |
| Comment by Githook User [ 25/Apr/23 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message:
|
| Comment by Jordi Olivares Provencio [ 09/Nov/22 ] |
|
The rollback path is also safe. Rollback returns an EBUSY error if there are any active cursors or transactions. That is, it will only succeed if there are no active users in WT. This error gets retried in 6.0+ as of |
| Comment by Jordi Olivares Provencio [ 31/Oct/22 ] |
|
Right now the shutdown path is safe. Sessions will all get killed and drained before shutting down the storage engine. This happens here. |