void-ptr974 opened a new pull request, #4789:
URL: https://github.com/apache/bookkeeper/pull/4789

     ### Motivation
   
     Batch reads could hang or fail after receiving a corrupt response from a 
bookie. The request was marked complete before digest verification, so although 
a digest mismatch triggered a retry
     on another replica, the retry response could be ignored because the 
request was already completed.
   
     ### Changes
   
     - Verify all entries in a batch response before completing the read 
request.
     - Keep the request incomplete on digest mismatch so the existing retry 
path can read the same batch from the next replica.
     - Avoid retaining partially verified entries when one entry in the batch 
fails digest verification.
     - Clarify the `ByteBufList` ownership and release paths with comments.
   
     ### Tests
   
     Added coverage for the batch-read digest mismatch retry path:
   
     - `testDigestMismatchRetriesNextReplicaAndCompletes`
       - Replaces the first replica with a real bookie that corrupts read 
responses.
       - Verifies that a digest mismatch does not complete the batch request 
prematurely.
       - Confirms the same batch is retried from another replica and completes 
with the original entry data.
   
     - `testDigestMismatchAfterPartialVerificationDoesNotRetainEntries`
       - Reads a two-entry batch where the first entry verifies successfully 
but the second entry is corrupted.
       - Verifies that no partially verified entries are retained after the 
digest mismatch.
       - Confirms the whole batch is retried from another replica and both 
returned entries match the original data.
   
     Also ran the full `TestBatchedRead` suite to ensure existing batch-read 
behavior remains unchanged, including normal reads, partial batch responses, 
missing entries, and failed bookie
     scenarios.


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