RockteMQ-AI commented on issue #10859:
URL: https://github.com/apache/rocketmq/issues/10859#issuecomment-5225836386
**Issue Evaluation**
Category: `bug` | Status: **Confirmed**
The reported issue has been verified against the current codebase (commit
`fd0c959`).
**Root Cause:** In `IndexStoreService.putKey()` (lines 214-231), after 3
retry attempts all fail, the method logs an error but returns
`AppendResult.SUCCESS`:
```java
for (int i = 0; i < 3; i++) {
AppendResult result = this.currentWriteFile.putKey(...);
if (AppendResult.SUCCESS.equals(result)) {
return AppendResult.SUCCESS;
} else if (AppendResult.FILE_FULL.equals(result)) {
this.createNewIndexFile(System.currentTimeMillis());
}
}
log.error("...");
return AppendResult.SUCCESS; // ← returns SUCCESS after all retries failed
```
If the 3rd attempt returns `FILE_FULL` and `createNewIndexFile()` also fails
(or the result is `UNKNOWN_ERROR`), the method still reports success.
**Impact:** Index writes silently fail — the caller believes the index entry
was persisted when it was not. This leads to missing index entries, causing
message lookup failures in the tiered store without any error indication.
**Severity:** high — silent data loss in the index layer with no error
propagation
**Suggested Fix:** Return the actual error result after exhausting retries:
```java
AppendResult lastResult = AppendResult.UNKNOWN_ERROR;
for (int i = 0; i < 3; i++) {
lastResult = this.currentWriteFile.putKey(...);
if (AppendResult.SUCCESS.equals(lastResult)) {
return AppendResult.SUCCESS;
} else if (AppendResult.FILE_FULL.equals(lastResult)) {
this.createNewIndexFile(System.currentTimeMillis());
}
}
log.error("...");
return lastResult;
```
An automated fix proposal will be generated. Reply `/approve` to proceed
with PR generation.
---
*Automated evaluation by RockteMQ-AI*
--
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]