[ 
https://issues.apache.org/jira/browse/HBASE-30584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153523#comment-18153523
 ] 

Hudson commented on HBASE-30584:
--------------------------------

Results for branch branch-3
        [build #207 on 
builds.a.o|https://ci-hbase.apache.org/job/HBase-Integration-Test/job/branch-3/207/]:
 (/) *{color:green}+1 overall{color}*
----
details (if available):



(/) {color:green}+1 client integration test for 3.3.5 {color}
(/) {color:green}+1 client integration test for 3.3.5 with shaded hadoop 
client{color}


(/) {color:green}+1 client integration test for 3.3.6 {color}
(/) {color:green}+1 client integration test for 3.3.6 with shaded hadoop 
client{color}


(/) {color:green}+1 client integration test for 3.4.0 {color}
(/) {color:green}+1 client integration test for 3.4.0 with shaded hadoop 
client{color}


(/) {color:green}+1 client integration test for 3.4.1 {color}
(/) {color:green}+1 client integration test for 3.4.1 with shaded hadoop 
client{color}


(/) {color:green}+1 client integration test for 3.4.2 {color}
(/) {color:green}+1 client integration test for 3.4.2 with shaded hadoop 
client{color}


(/) {color:green}+1 client integration test for 3.4.3 {color}
(/) {color:green}+1 client integration test for 3.4.3 with shaded hadoop 
client{color}


> LruBlockCache and LruAdaptiveBlockCache leak size accounting when an existing 
> block is replaced
> -----------------------------------------------------------------------------------------------
>
>                 Key: HBASE-30584
>                 URL: https://issues.apache.org/jira/browse/HBASE-30584
>             Project: HBase
>          Issue Type: Bug
>          Components: BlockCache
>            Reporter: Peter Somogyi
>            Assignee: Peter Somogyi
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 4.0.0-alpha-1, 2.7.0, 3.1.0, 3.0.1, 2.6.8, 2.5.17
>
>
> When {{cacheBlock}} is called for a key that is already cached and 
> {{BlockCacheUtil.shouldReplaceExistingCacheBlock}} returns true, 
> {{LruBlockCache.cacheBlock}} adds the new block's heap size to the size 
> counter and calls {{{}map.put{}}}, but never subtracts the block it 
> overwrites. The element counters are incremented again as well. 
> {{LruAdaptiveBlockCache.cacheBlock}} has the same code.
> Each replace permanently inflates the cache's size by one block. The leaked 
> bytes are not in the map, so eviction cannot free them. Once the counter 
> reaches the hard limit 
> ({{{}hbase.lru.blockcache.hard.capacity.limit.factor{}}} x acceptable size), 
> inserts are rejected even though the cache holds few or no blocks.
> h3. Why this became common
> The replace path used to be rare (HBASE-20447, split daughters racing on the 
> same block). Since {{BlockCacheUtil.getBlockForCaching}} preserves 
> {{nextBlockOnDiskSize}} (HBASE-29288 on branch-2/branch-3/master, HBASE-29398 
> on branch-2.6), it is hit routinely with CombinedBlockCache:
>  # Index and bloom blocks are cached in L1 at write time with 
> {{nextBlockOnDiskSize}} unset (cache-on-write for indexes/blooms, or 
> {{{}hbase.rs.cachecompactedblocksonwrite{}}}).
>  # Prefetch on open re-reads those blocks. {{HFilePreadReader}} only skips 
> blocks that BucketCache already has, and {{readBlock}} with 
> {{cacheOnly=true}} does not check the cache first.
>  # The prefetched copy has {{nextBlockOnDiskSize}} set, so 
> {{shouldReplaceExistingCacheBlock}} returns true and the L1 block is 
> replaced, leaking its size.
> This repeats for every flushed or compacted file, so the L1 size counter 
> grows until the cache stops accepting blocks.
> h3. Impact
> With L1 unable to hold index and bloom blocks, every read of them goes to the 
> filesystem under the per-offset {{IdLock}} in 
> {{{}HFileReaderImpl.readBlock{}}}. On a cluster reading from S3 we saw RPC 
> handlers blocked in {{IdLock.getLockEntry}} / {{HFileReaderImpl.readBlock}} 
> and a RegionServer slowdown.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to