Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.0
-
None
-
None
-
Reviewed
Description
HRegionServer.java
public CacheEvictionStats clearRegionBlockCache(Region region) { BlockCache blockCache = this.getCacheConfig().getBlockCache(); long evictedBlocks = 0; for(Store store : region.getStores()) { for(StoreFile hFile : store.getStorefiles()) { evictedBlocks += blockCache.evictBlocksByHfileName(hFile.getPath().getName()); } } return CacheEvictionStats.builder() .withEvictedBlocks(evictedBlocks) .withMaxCacheSize(blockCache.getMaxSize()) .build(); }
BlockCache is the regionserver level object.If we accumulate this value for each region, we will get a wrong result.
The value of maxCacheSize should be set to BlockCache.getMaxSize() after processing all the regions on this regionserver.