mwkang commented on code in PR #8469:
URL: https://github.com/apache/hbase/pull/8469#discussion_r3655128145
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -722,22 +727,48 @@ 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);
+ failedBucketEntryRead = true;
LOG.debug("Failed to fetch block for cache key: {}.", key, hioex);
} catch (IOException ioex) {
LOG.error("Failed reading block " + key + " from bucket cache", ioex);
checkIOErrorIsTolerated();
} finally {
lock.readLock().unlock();
}
+ if (failedBucketEntryRead) {
+ removeFailedBucketEntry(bucketEntry);
Review Comment:
Addressed in the latest revision. HBaseIOException and plain IOException now
follow separate paths.
Only the cached-time mismatch HBaseIOException marks the entry as
inconsistent and removes it after releasing the offset read lock. A plain
IOException only calls checkIOErrorIsTolerated(). While the error remains
within the configured tolerance, the backing-map entry, blocksByHFile entry,
fully-cached metadata, and owner reference are retained.
testPlainIOExceptionKeepsEntryAndCacheMetadata covers this behavior.
--
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]