From d03ffb078804cbac9f77a8ed17c64ffd43a89ae3 Mon Sep 17 00:00:00 2001 From: Mikhail Antonov Date: Sat, 28 May 2016 03:14:03 -0700 Subject: [PATCH] HBASE-15908 Checksum verification is broken due to incorrect passing of ByteBuffers in DataChecksum (Mikhail Antonov and Appy) --- .../main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java index a61038e0cd4..b2ed8d4e97a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java @@ -1725,7 +1725,7 @@ public class HFileBlock implements Cacheable { ByteBuffer onDiskBlockByteBuffer = ByteBuffer.wrap(onDiskBlock, 0, onDiskSizeWithHeader); // Verify checksum of the data before using it for building HFileBlock. if (verifyChecksum && - !validateChecksum(offset, onDiskBlockByteBuffer.asReadOnlyBuffer(), hdrSize)) { + !validateChecksum(offset, onDiskBlockByteBuffer, hdrSize)) { return null; } // The onDiskBlock will become the headerAndDataBuffer for this block.