[Bug] IndexStoreService reports success after index writes exhaust retries
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 27
Description
## Runtime platform environment
macOS; reproduced with a deterministic unit test in the `tieredstore` module.
## RocketMQ version
Branch: `develop`
Git commit: `fd0c95920e0deac96ce2ae27442747cc5e65e930`
## JDK Version
Eclipse Temurin 17.0.19+10
## Describe the Bug
`IndexStoreService.putKey` retries an index write three times. If every attempt fails, it logs an error but returns `AppendResult.SUCCESS`, so callers can treat an index entry that was never stored as successful.
## Steps to Reproduce
1. Set `currentWriteFile` to an `IndexFile` whose `putKey` returns `FILE_FULL`.
2. Keep file rotation from replacing that test file.
3. Call `IndexStoreService.putKey`.
4. Observe three failed attempts followed by a `SUCCESS` result.
## What Did You Expect to See?
The method should return the final failed `AppendResult` after all retries are exhausted.
## What Did You See Instead?
The method returns `SUCCESS` despite all three writes returning `FILE_FULL`.
## Additional Context
The normal success path and the existing three-attempt retry behavior do not need to change.
Contributor guide
Research direction
Start in the tieredstore module at IndexStoreService.putKey and inspect how it handles the three IndexFile.putKey attempts and their AppendResult values. Use the deterministic unit-test scenario with currentWriteFile returning FILE_FULL; done means exhausted retries return the final failed result while the normal success path and retry behavior remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100