Skip to content

[ISSUE #10878] fix(tieredstore): read across all file segments - #10888

Open
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0809-yuluo-yx/fix-9
Open

[ISSUE #10878] fix(tieredstore): read across all file segments#10888
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0809-yuluo-yx/fix-9

Conversation

@yuluo-yx

@yuluo-yx yuluo-yx commented Aug 9, 2026

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

FlatAppendFile.readAsync now collects reads from every intersecting committed segment and combines them in order. The previous one- or two-segment fast behavior remains, while a three-segment regression now returns all 250 requested bytes.

How Did You Test This Change?

  • mise exec java@zulu-8.94.0.17 -- mvn -pl tieredstore -am -DskipITs -Dtest=FlatAppendFileTest -Dsurefire.failIfNoSpecifiedTests=false test (7 tests passed)
  • Checkstyle and SpotBugs passed in the same Maven reactor.
  • git diff --check and the 400-line scope gate passed.
  • Not run: full repository build, container tests, or end-to-end tests.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.30%. Comparing base (fd0c959) to head (8f59244).

Files with missing lines Patch % Lines
...ache/rocketmq/tieredstore/file/FlatAppendFile.java 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10888      +/-   ##
=============================================
- Coverage      48.39%   48.30%   -0.09%     
+ Complexity     13562    13535      -27     
=============================================
  Files           1380     1380              
  Lines         101165   101172       +7     
  Branches       13127    13126       -1     
=============================================
- Hits           48962    48876      -86     
- Misses         46233    46308      +75     
- Partials        5970     5988      +18     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Review of PR #10888: [ISSUE #10878] fix(tieredstore): read across all file segments

This PR modifies 2 file(s) with 45 additions and 14 deletions.
Changes look reasonable. No critical issues found in the diff.


Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR generalizes FlatAppendFile.readAsync() to read across an arbitrary number of file segments instead of the previous hard-coded 2-segment limit. The implementation uses a loop to iterate segments and CompletableFuture.allOf() for parallel reads, then combines results into a single ByteBuffer.

The fix is correct: the loop properly tracks readOffset and remainingLength, and the segment length calculation handles boundary conditions. The test covers the 3-segment case. LGTM.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] FlatAppendFile readAsync truncates reads spanning more than two segments

3 participants