You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2021/10/01 13:07:48 UTC

[hbase] branch branch-2 updated: HBASE-26305 Move NavigableSet add operation to writer thread in BucketCache (#3705)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new a2c09ae  HBASE-26305 Move NavigableSet add operation to writer thread in BucketCache (#3705)
a2c09ae is described below

commit a2c09ae5bc8b797397a31daf9392675655f746e5
Author: Yutong Xiao <yu...@gmail.com>
AuthorDate: Fri Oct 1 20:57:51 2021 +0800

    HBASE-26305 Move NavigableSet add operation to writer thread in BucketCache (#3705)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
    Reviewed-by: chenglei <ch...@apache.org>
---
 .../java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
index 67f64d5..de7abd2 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
@@ -475,7 +475,6 @@ public class BucketCache implements BlockCache, HeapSize {
     } else {
       this.blockNumber.increment();
       this.heapSize.add(cachedItem.heapSize());
-      blocksByHFile.add(cacheKey);
     }
   }
 
@@ -1016,6 +1015,11 @@ public class BucketCache implements BlockCache, HeapSize {
           index++;
           continue;
         }
+        BlockCacheKey cacheKey = re.getKey();
+        if (ramCache.containsKey(cacheKey)) {
+          blocksByHFile.add(cacheKey);
+        }
+
         BucketEntry bucketEntry = re.writeToCache(ioEngine, bucketAllocator, realCacheSize,
           this::createRecycler);
         // Successfully added. Up index and add bucketEntry. Clear io exceptions.