HBASE-26155 JVM crash when scan (#3553)

Signed-off-by: Michael Stack <stack@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Xiaolin Ha 2021-08-12 17:09:18 +08:00 committed by haxiaolin
parent 6b9114d95e
commit e8ecafb22b
1 changed files with 5 additions and 0 deletions

View File

@ -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 {