ndimiduk commented on code in PR #5352:
URL: https://github.com/apache/hbase/pull/5352#discussion_r1315650212


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileBlock.java:
##########
@@ -1729,7 +1729,31 @@ protected HFileBlock 
readBlockDataInternal(FSDataInputStream is, long offset,
         }
         onDiskSizeWithHeader = getOnDiskSizeWithHeader(headerBuf, 
checksumSupport);
       }
-      int preReadHeaderSize = headerBuf == null ? 0 : hdrSize;
+      int preReadHeaderSize = 0;
+      if (
+        headerBuf == null
+          || headerBuf.getInt(Header.ON_DISK_SIZE_WITHOUT_HEADER_INDEX) != 
onDiskSizeWithHeader

Review Comment:
   The value read from `onDiskSizeWithoutHeader` should never equal 
`onDiskSizeWithHeader`, right?
   
   > 1: onDiskSizeWithoutHeader: Compressed -- a.k.a 'on disk' -- block size, 
excluding header, but including tailing checksum bytes (4 bytes)
   
   While `onDiskSizeWithHeader` should be the entire serialized block: header + 
serialized data + checksums.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to