[ https://issues.apache.org/jira/browse/HBASE-20789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16525786#comment-16525786 ]
Duo Zhang commented on HBASE-20789: ----------------------------------- {quote} caching an already cached block was present long before HBASE-20447 (see [2]). It seems that to fix your memory leak case we need to add locking on the key. {quote} The line you provide is to prevent caching the already cached block... But with HBASE-20447 if the nextBlockOnDiskSize is different, we may ignore this check and then caching the already cached block and cause memory leak. And as I said above, the original code before HBASE-20447 may still have races and cause caching an already cached block. I think we may need to add a check in the WriterThread to prevent this... > TestBucketCache#testCacheBlockNextBlockMetadataMissing is flaky > --------------------------------------------------------------- > > Key: HBASE-20789 > URL: https://issues.apache.org/jira/browse/HBASE-20789 > Project: HBase > Issue Type: Bug > Reporter: Zheng Hu > Assignee: Zheng Hu > Priority: Major > Fix For: 3.0.0, 2.1.0, 1.5.0, 1.4.6, 2.0.2 > > Attachments: bucket-33718.out > > > The UT failed frequently in our internal branch-2... Will dig into the UT. -- This message was sent by Atlassian JIRA (v7.6.3#76005)