Julian Chandra Sutadi created HBASE-30453:
---------------------------------------------
Summary: BucketCache region cached size is not decremented on
eviction for non-persistent IOEngines
Key: HBASE-30453
URL: https://issues.apache.org/jira/browse/HBASE-30453
Project: HBase
Issue Type: Bug
Reporter: Julian Chandra Sutadi
HBASE-29707 fixed the issue of region cache % metric going above 100% on two
cases:
# compacted blocks not being subtracted from the cached block metrics during
compaction
# caches of archived HFiles accounted for the original region.
The issue was fixed by making the decrement per block in fileNotFullyCached.
However, fileNotFullyCached is only called for persistent IOEngines, while the
increment runs for every IOEngine:
{code:java}
// BucketCache.putIntoBackingMap: increments for every IOEngine
protected void putIntoBackingMap(BlockCacheKey key, BucketEntry bucketEntry) {
BucketEntry previousEntry = backingMap.put(key, bucketEntry);
updateRegionCachedSize(key, bucketEntry.getLength());
...
}
// BucketCache.blockEvicted: decrements only for persistent IOEngines
void blockEvicted(BlockCacheKey cacheKey, BucketEntry bucketEntry,
boolean decrementBlockNumber, boolean evictedByEvictionProcess) {
...
if (decrementBlockNumber) {
this.blockNumber.decrement();
if (ioEngine.isPersistent()) {
fileNotFullyCached(cacheKey, bucketEntry);
}
}
...
}
// BucketCache.fileNotFullyCached: the only decrement
private void fileNotFullyCached(BlockCacheKey key, BucketEntry entry) {
updateRegionCachedSize(key, (entry.getLength() * -1));
fullyCachedFiles.remove(key.getHfileName());
}{code}
The suggested fix is to move the decrement outside the isPersistent() check,
since region accounting is not persistence-specific.
We will submit the fix proposal soon.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)