[SERVER-73464] AutoGetCollectionForReadLockFree can leak lastApplied read source setting Created: 30/Jan/23  Updated: 29/Oct/23  Resolved: 01/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Henrik Edin Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2023-02-06
Participants:
Linked BF Score: 160

 Description   

AutoGetCollectionForReadLockFree modifies the read source and sets it to lastApplied if needed. This setting is not restored at destruction or when the storage engine snapshot is closed. If we concurrently have become a writable primary this is problematic for any subsequent operation that doesn't use AutoGetCollectionForReadLockFree as we do not generally handle the lastApplied read source.



 Comments   
Comment by Githook User [ 01/Feb/23 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-73464 Reset lastApplied read source to default when storage snapshot closes

AutoGetCollectionLockFree modifies the read source as needed but leaks the state which can cause issues for subsequent operations. This makes lastApplied a little different from the other read sources but is a first small step to always reset the read source when we close the storage engine transaction.
Branch: master
https://github.com/mongodb/mongo/commit/810bc652885578ab293680db7f475ebaf947599f

Generated at Thu Feb 08 06:24:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.