[SERVER-54448] Add an invariant to a query yield path, releasing only the storage snapshot, to ensure lock-free reads operations never accidentally use it Created: 10/Feb/21 Updated: 29/Oct/23 Resolved: 23/Apr/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Dianna Hohensee (Inactive) | Assignee: | Dianna Hohensee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Execution Team 2021-03-08, Execution Team 2021-05-03 |
| Participants: |
| Description |
|
This bit of code calling abandonSnapshot without releasing locks is not currently run by lock-free read operations, but we should make sure that we never accidentally do so without knowing about it. We can add an invariant that opCtx->isLockFreeReadsOp() returns false. |
| Comments |
| Comment by Githook User [ 23/Apr/21 ] |
|
Author: {'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}Message: |
| Comment by Dianna Hohensee (Inactive) [ 10/Feb/21 ] |
|
This is really not a definitive general solution. Ideally, we'd want to somehow ensure that abandonSnapshot() is never called for AutoGet*LockFree instances, except for when we do want to yield locks – even trickier. It's unclear to me right now how to achieve that ideal, however. Probably worth some further thought at some point. |