[
https://issues.apache.org/jira/browse/HBASE-16157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15359521#comment-15359521
]
ChiaPing Tsai commented on HBASE-16157:
---------------------------------------
It seem to me the v4 patch is better. The reasons are shown below:
1) The v4 patch makes LruBlockCache#evictBlocksByHfileName return the correct
number of evicted block.
2) The v4 patch use the threads to test the thread-safe of cache eviction.
> The incorrect block cache count and size are caused by removing duplicate
> block key in the LruBlockCache
> --------------------------------------------------------------------------------------------------------
>
> Key: HBASE-16157
> URL: https://issues.apache.org/jira/browse/HBASE-16157
> Project: HBase
> Issue Type: Bug
> Reporter: ChiaPing Tsai
> Priority: Trivial
> Attachments: HBASE-16157-v1.patch, HBASE-16157-v2.patch,
> HBASE-16157-v3.patch, HBASE-16157-v4.patch
>
>
> {code:title=LruBlockCache.java|borderStyle=solid}
> // Check return value from the Map#remove before updating the metrics
> protected long evictBlock(LruCachedBlock block, boolean
> evictedByEvictionProcess) {
> map.remove(block.getCacheKey());
> updateSizeMetrics(block, true);
> ...
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)