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

   ## What changes were proposed in this pull request?
   PutBlock reply handlers of one Ratis `BlockOutputStream` can run out of 
order. The Ratis client completes the replies in order, but thenApplyAsync runs 
each handler on the shared responseExecutor, so the handler of a later PutBlock 
can run before the handler of an earlier one. That handler moves the bcsId 
backward, and close() can send OM the full block length with the older bcsId. 
If a later request fails first, `CommitWatcher` can also acknowledge the later 
buffers while the earlier data is still allocated, and the retry rewrites that 
earlier data.
   
   Each PutBlock handler, including a piggybacked PutBlock on WriteChunk, now 
waits with thenCombineAsync until the previous handler of that stream has 
finished. The handlers run in send order, so the bcsId only moves forward and 
the acknowledged buffers stay a prefix of the block.
   
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-17668
   
   ## How was this patch tested?
   Added two tests in `TestBlockOutputStreamCorrectness`. The tests queue the 
handlers and run the newest one first. One checks that the bcsId stays at the 
last PutBlock. The other fails a later write and checks that the buffers still 
allocated are the bytes after the acknowledged length.


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