beautyarbutin opened a new pull request, #11184:
URL: https://github.com/apache/rocketmq/pull/11184

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10878
   
   ### Brief Description
   
   `FlatAppendFile.readAsync` previously combined at most the segment 
containing the requested offset and the immediately following segment. Reads 
spanning three or more committed segments therefore returned a truncated buffer.
   
   This change starts an asynchronous read for every segment covered by the 
request, waits for all reads to complete, and combines their buffers in segment 
order. The existing single-segment fast path and final-segment truncation 
behavior are preserved.
   
   A regression test creates three 100-byte consume-queue segments with 
distinct byte values, reads 250 bytes starting at offset 50, and verifies the 
complete length and byte ordering across all three segments.
   
   ### How Did You Test This Change?
   
   On the unmodified implementation, the new regression failed with 
`expected.length=250 actual.length=150`.
   
   After the fix:
   
   ```
   mvn -pl tieredstore -am -DskipITs -Dtest=FlatAppendFileTest 
-Dsurefire.failIfNoSpecifiedTests=false test
   ```
   
   - `FlatAppendFileTest`: 7 tests passed
   - Checkstyle: 0 violations
   - SpotBugs: no errors or warnings


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