[
https://issues.apache.org/jira/browse/HBASE-22480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16849298#comment-16849298
]
Zheng Hu commented on HBASE-22480:
----------------------------------
There're several place where we did not consider the release or release
incorrectly I think:
1. in seekBefore method ( see
[Line-882|https://github.com/apache/hbase/blob/8e47c8e73943b9595b2a8bfea131b106a3947fbd/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java#L882]),
if the previousBlockOffset is -1, we return -1 without returning the
seekToBlock back to blockcache, it's a memory leak issue;
2. in updateCurrentBlock(see
[L1199|https://github.com/apache/hbase/blob/8e47c8e73943b9595b2a8bfea131b106a3947fbd/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java#L1199])
method (Both HFileScannerImpl and EncodedScanner), there's possible that we
did not make the curBlock refer to the newBlock , such as some exception happen
or the newBlock has the same offset but another instance, etc.
So I think a generic method to *release the newBlock but except the curBlock*
will be a better abstraction to handle all those places. I also handled the
similar issues In my PR for branch HBASE-21879
[PR-257|https://github.com/apache/hbase/pull/257/files#diff-f14c59a7641b9c63cf302f41af83fa35].
> Get block from BlockCache once and return this block to BlockCache twice make
> ref count error.
> ----------------------------------------------------------------------------------------------
>
> Key: HBASE-22480
> URL: https://issues.apache.org/jira/browse/HBASE-22480
> Project: HBase
> Issue Type: Sub-task
> Reporter: binlijin
> Assignee: binlijin
> Priority: Major
> Attachments: HBASE-22480-master-v1.patch, HBASE-22480-master-v2.patch
>
>
> After debugging HBASE-22433, i find the problem it is that we get a block
> from BucketCache once and return this block to BucketCache twice and make the
> ref count error, sometimes the refCount can be negative.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)