[Bug] The last index file should not be deleted when the broker recovers abnormally
Before Creating the Bug Report
- [X] I found a bug, not just asking a question, which should be created in GitHub Discussions.
- [X] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
- [X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment
5.10.112-005.ali5000.alios7.x86_64
RocketMQ version
develop version: 5.1.4
JDK Version
JDK11
Describe the Bug
The last index file should not be deleted when the broker recovers abnormally.
Steps to Reproduce
- First, send more than 3GB of data to the broker, then terminate the broker process using "kill -9" and restart it.
- The broker will enter an abnormal recovery process and delete the last index file.
- We can't query message by message uniqueKey which earliest send, it would return failed.
What Did You Expect to See?
The last index file should not be deleted when the broker recovers abnormally
What Did You See Instead?
The last index file should not be deleted when the broker recovers abnormally
Additional Context
- Avoid crashes and retain the last file.
- The next value must be smaller than the current one in "index item" to prevent issues of Infinite loop caused by file corruption.
I want to try to solve this problem, can you assign it to me
OK, could you first describe the improvement plan.
It looks like we need to keep the first index file that needs to be deleted
Can we initiate an email or wechat discussion
This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.
This issue was closed because it has been inactive for 3 days since being marked as stale.