Huginn-kio opened a new pull request, #8661:
URL: https://github.com/apache/hbase/pull/8661

   ## HBASE-30392
   
   ### Summary
   
   Keep the size metadata of cache-on-write HFile blocks consistent with the 
bytes stored in the cache. See 
[HBASE-30392](https://issues.apache.org/jira/browse/HBASE-30392).
   
   ### Root cause
   
   `HFileBlock.Writer#getBlockForCaching` creates the cache buffer with 
`cloneOnDiskBufferWithHeader()`, which contains only the block header and 
on-disk data. The metadata was nevertheless populated with 
`onDiskBlockBytesWithHeader.size() + onDiskChecksum.length`, so 
`onDiskDataSizeWithHeader` described bytes that are not present in the cache 
buffer.
   
   ### Fix
   
   - Set `onDiskDataSizeWithHeader` to the header-plus-data buffer length.
   - Keep `onDiskSizeWithoutHeader` unchanged because the physical on-disk 
block size still includes checksums.
   
   ### Compatibility
   
   - No public API or configuration change.
   - No HFile on-disk format change.
   - The change only corrects in-memory cache metadata for cache-on-write 
blocks.
   
   ### Testing
   
   - `git diff --check` passed.
   - `hbase-server` reactor compile was run with JDK 17; the result will be 
reported after completion.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to