mwkang commented on code in PR #8469:
URL: https://github.com/apache/hbase/pull/8469#discussion_r3570638298


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -722,15 +764,17 @@ public Cacheable getBlock(BlockCacheKey key, boolean 
caching, boolean repeat,
         // When using file io engine persistent cache,
         // the cache map state might differ from the actual cache. If we reach 
this block,
         // we should remove the cache key entry from the backing map
-        backingMap.remove(key);
-        fileNotFullyCached(key, bucketEntry);

Review Comment:
   Good catch. In the revised patch, the failed-read path now releases the 
offset read lock first, finds the actual key stored in backingMap, and removes 
the entry under its offset write lock.
   
   After a successful conditional removal, it calls blockEvicted(cacheKey, 
bucketEntry, true, false), which invokes fileNotFullyCached for persistent IO 
engines. This keeps the file and region cache metadata used by the cache-aware 
load balancer consistent.
   
   I also added regression tests for both direct and reference-file lookups.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to