Dimas Shidqi Parikesit created HBASE-30038:
----------------------------------------------

             Summary: RefCnt Leak error when caching
                 Key: HBASE-30038
                 URL: https://issues.apache.org/jira/browse/HBASE-30038
             Project: HBase
          Issue Type: Bug
            Reporter: Dimas Shidqi Parikesit


This bug is similar to 
[HBASE-28890|https://issues.apache.org/jira/browse/HBASE-28890]

HFileBlock.Writer.getBlockForCaching() creates a ref-counted HFileBlock, and 
the caller must release its own reference after the cache has taken the 
ownership it needs. 

In HFileWriterImpl.java, the leak happened when shouldCacheBlock() returned 
before cacheFormatBlock.release() ran.

In HFileBlockIndex.java, the intermediate-index path cached blockForCaching but 
never released the reference at all. 

Because these blocks can be backed by pooled off-heap ByteBuffs, repeated HFile 
writes could steadily drain allocator buffers and effectively leak memory, even 
though the blocks were only meant to live long enough to be considered for 
cache-on-write.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to