[SERVER-47916] Out of order destruction of ValueHandles returned by InvalidatingLRUCache can break the invalidation guarantees Created: 04/May/20  Updated: 29/Oct/23  Resolved: 07/May/20

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 4.4.0-rc3
Fix Version/s: 4.4.0-rc7, 4.7.0

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

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Sharding 2020-05-18
Participants:

 Description   

The destructor of InvalidatingLRUCache::StoredValue unconditionally removes entries from the _evictedCheckedOutValues map. This means it is possible that an old ValueHandle, which goes out of scope after a newer value for the same key has been evicted, will remove the newer value from that map. This in turn will prevent such a value from getting invalidated.

The solution is to only erase from the _evictedCheckedOutValues if the StoredValue corresponds to the same epoch for the key.



 Comments   
Comment by Githook User [ 15/May/20 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-47916 Make InvalidatingLRUCache use an 'epoch' when invalidating evicted checked-out values

(cherry picked from commit 7ee768a17cbc78f42c8e8938df2c68635f871bdf)
Branch: v4.4
https://github.com/mongodb/mongo/commit/3455ab4ba560647809b3ac49910b00ec19bfff85

Comment by Githook User [ 07/May/20 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-47916 Make InvalidatingLRUCache use an 'epoch' when invalidating evicted checked-out values
Branch: master
https://github.com/mongodb/mongo/commit/7ee768a17cbc78f42c8e8938df2c68635f871bdf

Generated at Thu Feb 08 05:15:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.