You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ha...@apache.org on 2021/08/12 09:21:27 UTC

[hbase] branch branch-2.4 updated: HBASE-26155 JVM crash when scan (#3553)

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

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


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 2d89b08  HBASE-26155 JVM crash when scan (#3553)
2d89b08 is described below

commit 2d89b08eb08547f5530128001b3c3471092fa778
Author: Xiaolin Ha <ha...@apache.org>
AuthorDate: Thu Aug 12 17:09:18 2021 +0800

    HBASE-26155 JVM crash when scan (#3553)
    
    Signed-off-by: Michael Stack <st...@apache.org>
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 .../java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java    | 5 +++++
 1 file changed, 5 insertions(+)

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 80f6833..c24494f 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
@@ -420,6 +420,11 @@ public class BucketCache implements BlockCache, HeapSize {
     if (cacheEnabled) {
       if (backingMap.containsKey(cacheKey) || ramCache.containsKey(cacheKey)) {
         if (BlockCacheUtil.shouldReplaceExistingCacheBlock(this, cacheKey, cachedItem)) {
+          BucketEntry bucketEntry = backingMap.get(cacheKey);
+          if (bucketEntry != null && bucketEntry.isRpcRef()) {
+            // avoid replace when there are RPC refs for the bucket entry in bucket cache
+            return;
+          }
           cacheBlockWithWaitInternal(cacheKey, cachedItem, inMemory, wait);
         }
       } else {