Skip to content

Commit

Permalink
HBASE-23375 HBASE-22441 BucketCache NullPointerException in cacheBlock
Browse files Browse the repository at this point in the history
branches-1 backport. closes #907

Co-authored-by: binlijin <binlijin@apache.org>
Signed-off-by: binlijin <binlijin@apache.org>
Signed-off-by: Viraj Jasani <virajjasani007@gmail.com>
Signed-off-by: Sean Busbey <busbey@apache.org>
  • Loading branch information
2 people authored and busbey committed Dec 13, 2019
1 parent 84c0a90 commit 28673f0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ public static int validateBlockAddition(Cacheable existing, Cacheable newBlock,
public static boolean shouldReplaceExistingCacheBlock(BlockCache blockCache,
BlockCacheKey cacheKey, Cacheable newBlock) {
Cacheable existingBlock = blockCache.getBlock(cacheKey, false, false, false);
if (existingBlock == null) {
return true;
}
int comparison = BlockCacheUtil.validateBlockAddition(existingBlock, newBlock, cacheKey);
if (comparison < 0) {
LOG.warn("Cached block contents differ by nextBlockOnDiskSize, the new block has "
Expand Down

0 comments on commit 28673f0

Please sign in to comment.