ss77892 opened a new pull request, #12069:
URL: https://github.com/apache/ozone/pull/12069

   ## What changes were proposed in this pull request?
   
   For a streamed `ReadBlock`, the datanode always widens the requested range 
to checksum boundaries. That is needed only when the response carries checksums 
(`includeChecksums=true`) or the datanode verifies them 
(`validateChunkChecksumData`). When neither is true, the extra bytes are read 
from disk, sent over gRPC, and then thrown away by the client.
   
   This is the normal case for HBase: it calls `setVerifyChecksum(false)` 
(honoured by o3fs/ofs since HDDS-16783), so every read arrives with 
`includeChecksums=false`. A ~64 KiB HFile block read moves ~81.6 KiB instead of 
~65.6 KiB.
   
   Changes:
   
   - `BlockReadCursor` gets an `aligned` flag. When false, it returns ranges 
covering exactly the requested bytes (clamped to the block end, still split by 
`responseDataSize`), with no chunk infos, and skips building the checksum 
tables.
   - `KeyValueHandler.readBlockImpl` passes `aligned = includeChecksums || 
validateChunkChecksumData`.
   
   No proto change. `includeChecksums` defaults to true, so old clients and 
checksum-verifying reads behave as before. The client already positions each 
response by its `offset`, so it needs no change (only a comment is updated).
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17808
   
   ## How was this patch tested?
   
   - New 
`TestBlockReadCursor#testUnalignedRangesCoverExactlyTheRequestedBytes`: exact 
ranges, clamping to block end, no widening inside one checksum interval, zero 
length, and aligned ranges unchanged for the same request.
   - Updated `TestKeyValueHandler#testReadBlockWithoutResponseChecksums`: with 
datanode validation on, ranges stay aligned; with it off, ranges are exact and 
the bytes are correct.
   
   HBase 2.6 over o3fs, YCSB random reads (20M records, 20 threads, 600 s), 3 
datanodes, RATIS/THREE, same build, A/B on this change only:
   
   | | before | after |
   |---|---|---|
   | throughput | 52,355 ops/s | 56,923 ops/s (+8.7%) |
   | READ avg | 380 us | 350 us |
   | READ p99 | 715 us | 626 us |
   
   CI: <link>
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to