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

   ## What changes were proposed in this pull request?
   
   A seek on a key sends one GetBlock for every block of the key, not only for 
the block it reads. `MultipartInputStream#initialize` calls 
`BlockInputStream#initialize` on all blocks (from HDDS-11220). Only an 
under-construction block needs that, to get its length from the datanode. OM 
already has the length of the other blocks.
   
   S3 Gateway seeks for every range GET, so a range GET on a multipart object 
costs one GetBlock for each part.
   
   With this change:
   - `BlockInputStream#updateBlockLength` initializes the block only if it is 
under construction. `StreamBlockInputStream` already has a method with this 
name that does the same.
   - `MultipartInputStream#initialize` calls it instead of `initialize`. The 
other blocks initialize on their first read, as they already do when there is 
no seek.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17916
   
   ## How was this patch tested?
   
   New tests:
   - `TestMultipartInputStream`: a seek into the second block and a read get 
block data only for that block, and a seek past the stale OM length of an 
under-construction block works.
   - `TestBlockInputStream`: `updateBlockLength` takes the length of an 
under-construction block from the datanode.
   
   The two `TestMultipartInputStream` tests fail without the fix. `TestHSync` 
passes locally.
   
   Manual test on a cluster with 3 datanodes, through S3 Gateway: 2,000 random 
4 KiB range GETs on an 80 MiB object with 16 parts. GetBlock requests for each 
GET go from 16 to 1, and the p50 latency goes from 10.9 ms to 5.7 ms. 
Single-block objects do not change.
   


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