[SERVER-54116] An AutoGetCollectionForReadLockFree instantiated under a AutoGetCollectionForRead with an already open storage snapshot invariants Created: 28/Jan/21 Updated: 29/Oct/23 Resolved: 16/Feb/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | 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 | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Sprint: | Execution Team 2021-02-22 | ||||
| Participants: | |||||
| Linked BF Score: | 52 | ||||
| Description |
|
Lock-free reads must be able to handle AutoGetCollectionForReadLockFree being instantiated under an AutoGetCollectionForRead that has already opened a storage snapshot/transaction. OR, abandonSnapshot() must be called before or in AutoGetCollectionForReadLockFree somehow. Scenario where the bug surfaced: |
| Comments |
| Comment by Githook User [ 16/Feb/21 ] |
|
Author: {'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}Message: This avoids using a -LockFree helper, via the DBDirectClient, that must reset the storage snapshot. |
| Comment by Dianna Hohensee (Inactive) [ 28/Jan/21 ] |
|
A simple solution might be to pivot in supportsLockFreeRead() based on whether there are any collection locks held. Update: checking for a collection lock would be clean, but also costly, because the isCollectionLockedForMode function is not cheap. Therefore, shouldn't use that on all LFR reads. |