Andrew Kyle Purtell created HBASE-27867:
-------------------------------------------
Summary: Close the L1 victim handler race
Key: HBASE-27867
URL: https://issues.apache.org/jira/browse/HBASE-27867
Project: HBase
Issue Type: Bug
Components: BlockCache
Affects Versions: 2.5.4
Reporter: Andrew Kyle Purtell
Assignee: Andrew Kyle Purtell
Fix For: 2.6.0, 3.0.0-alpha-4, 2.5.5
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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)