Skip to content

[ISSUE #10859] Fix exhausted tiered index write result - #10864

Open
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-16
Open

[ISSUE #10859] Fix exhausted tiered index write result#10864
yuluo-yx wants to merge 1 commit into
apache:developfrom
yuluo-yx:0808-yuluo/fix-16

Conversation

@yuluo-yx

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

Copy link
Copy Markdown
Member

Which Issue(s) This PR Fixes

Brief Description

IndexStoreService.putKey previously returned SUCCESS after all three index write attempts failed. This change keeps the last AppendResult and returns it when retries are exhausted, while preserving the existing success and file-rotation paths.

A regression test makes the index file return FILE_FULL three times and verifies both the returned error and retry count.

How Did You Test This Change?

  • mise exec java@temurin-17.0.19+10 -- mvn -pl tieredstore -am -DskipITs -Dtest=IndexStoreServiceTest -Dsurefire.failIfNoSpecifiedTests=false test
  • Result: BUILD SUCCESS; 11 tests, 0 failures, 0 errors, 0 skipped.
  • Scope check: 2 files, 24 changed lines.

@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

Fixes a critical data integrity bug where TieredIndexFileStore.putKey returned AppendResult.SUCCESS even after all 3 write retries failed, potentially causing message index data loss.

Analysis

  • Correctness ✅ — Returning SUCCESS when writes actually failed is a severe data integrity issue. The fix to return the actual error result from the last attempt is minimal and correct. Callers can now properly detect and handle write failures.
  • Tests ✅ — Regression test mocks FILE_FULL status and verifies the error propagates correctly.
  • Compatibility ✅ — No API changes; callers that checked the return value will now correctly receive failure instead of a false success.

LGTM.


Automated review by github-manager-bot

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.29%. Comparing base (fd0c959) to head (b053a2c).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10864      +/-   ##
=============================================
- Coverage      48.39%   48.29%   -0.11%     
+ Complexity     13562    13523      -39     
=============================================
  Files           1380     1380              
  Lines         101165   101166       +1     
  Branches       13127    13127              
=============================================
- Hits           48962    48854     -108     
- Misses         46233    46317      +84     
- Partials        5970     5995      +25     

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

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] IndexStoreService reports success after index writes exhaust retries

3 participants