Skip to content

HBASE-30038: RefCnt Leak error when caching#7995

Open
dParikesit wants to merge 2 commits intoapache:masterfrom
dParikesit:5-RefCnt-release
Open

HBASE-30038: RefCnt Leak error when caching#7995
dParikesit wants to merge 2 commits intoapache:masterfrom
dParikesit:5-RefCnt-release

Conversation

@dParikesit
Copy link
Copy Markdown
Contributor

JIRA: HBASE-30038

This bug is similar to 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants