Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.5.4
-
None
-
Reviewed
Description
When we evict a block from L1 and move it to L2 there is a brief window of time where we have removed the block from the L1 map and yet the victim handler has not completed execution. Some read-your-write use cases can be significantly impacted even though the window is small. Imagine a use case where PRELOAD_DATA_ON_OPEN and CACHE_DATA_ON_WRITE are both enabled to warm cache ahead of access and any miss can be problematic. Perhaps a particularly latency sensitive case with HFiles backed by S3.
Victim handling can be made atomic with respect to the unmapping operation with ConcurrentHashMap#computeIfPresent. The upside is there will be no L1+L2 misses during the transition. The downside is if the victim handler takes a long time to execute – currently they are all very fast, so only a theoretical risk – then other removals or insertions in L1 can block until it completes.
Attachments
Issue Links
- links to