Skip to content

Commit 238c9b4

Browse files
authored
HBASE-26155 JVM crash when scan (apache#3553)
Signed-off-by: Michael Stack <stack@apache.org> Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent d307a8f commit 238c9b4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,11 @@ public void cacheBlockWithWait(BlockCacheKey cacheKey, Cacheable cachedItem, boo
430430
if (cacheEnabled) {
431431
if (backingMap.containsKey(cacheKey) || ramCache.containsKey(cacheKey)) {
432432
if (BlockCacheUtil.shouldReplaceExistingCacheBlock(this, cacheKey, cachedItem)) {
433+
BucketEntry bucketEntry = backingMap.get(cacheKey);
434+
if (bucketEntry != null && bucketEntry.isRpcRef()) {
435+
// avoid replace when there are RPC refs for the bucket entry in bucket cache
436+
return;
437+
}
433438
cacheBlockWithWaitInternal(cacheKey, cachedItem, inMemory, wait);
434439
}
435440
} else {

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
import org.apache.hadoop.hbase.CellComparator;
3030
import org.apache.hadoop.hbase.CellUtil;
3131
import org.apache.hadoop.hbase.DoNotRetryIOException;
32-
import org.apache.hadoop.hbase.HConstants;
33-
import org.apache.hadoop.hbase.PrivateCellUtil;
3432
import org.apache.hadoop.hbase.KeyValue;
3533
import org.apache.hadoop.hbase.KeyValueUtil;
34+
import org.apache.hadoop.hbase.PrivateCellUtil;
3635
import org.apache.hadoop.hbase.PrivateConstants;
3736
import org.apache.hadoop.hbase.client.IsolationLevel;
3837
import org.apache.hadoop.hbase.client.Scan;

0 commit comments

Comments
 (0)