[
https://issues.apache.org/jira/browse/HBASE-13301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
zhangduo updated HBASE-13301:
-----------------------------
Attachment: HBASE-13301-testcase_v1.patch
A new testcase shows that it is possible to evict and cache a block again in
real world. Move to another RS and move back can make this happen.
Of course, this is a rarest case. It is almost impossible for a thread to halt
for such a long time. But this a time bomb. I do not think it is a good idea to
leave it there and wait for a bang...
I will try to fix it.
Thanks.
> Possible memory leak in BucketCache
> -----------------------------------
>
> Key: HBASE-13301
> URL: https://issues.apache.org/jira/browse/HBASE-13301
> Project: HBase
> Issue Type: Bug
> Components: BlockCache
> Reporter: zhangduo
> Assignee: zhangduo
> Attachments: HBASE-13301-testcase.patch, HBASE-13301-testcase_v1.patch
>
>
> {code:title=BucketCache.java}
> public boolean evictBlock(BlockCacheKey cacheKey) {
> ...
> if (bucketEntry.equals(backingMap.remove(cacheKey))) {
> bucketAllocator.freeBlock(bucketEntry.offset());
> realCacheSize.addAndGet(-1 * bucketEntry.getLength());
> blocksByHFile.remove(cacheKey.getHfileName(), cacheKey);
> if (removedBlock == null) {
> this.blockNumber.decrementAndGet();
> }
> } else {
> return false;
> }
> ...
> {code}
> I think the problem is here. We remove a BucketEntry that should not be
> removed by us, but we do not put it back and also do not do any clean up.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)