Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-19561

maxCacheSize in CacheEvictionStats can't be accumulated repeatedly When dealing with each region

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0-beta-1, 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.

      Attachments

        1. HBASE-19561.master.001.patch
          2 kB
          Guangxu Cheng

        Activity

          People

            gxcheng Guangxu Cheng
            gxcheng Guangxu Cheng
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: