Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The last index file should not be deleted when the broker recovers abnormally #8007

Open
3 tasks done
lizhimins opened this issue Apr 9, 2024 · 4 comments · May be fixed by #8018
Open
3 tasks done

[Bug] The last index file should not be deleted when the broker recovers abnormally #8007

lizhimins opened this issue Apr 9, 2024 · 4 comments · May be fixed by #8018
Assignees

Comments

@lizhimins
Copy link
Member

lizhimins commented Apr 9, 2024

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.
  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
  • 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.

image

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.
@3424672656
Copy link
Contributor

I want to try to solve this problem, can you assign it to me

@lizhimins
Copy link
Member Author

lizhimins commented Apr 10, 2024

OK, could you first describe the improvement plan.

@3424672656
Copy link
Contributor

It looks like we need to keep the first index file that needs to be deleted

@3424672656
Copy link
Contributor

Can we initiate an email or wechat discussion

@HScarb HScarb linked a pull request Apr 17, 2024 that will close this issue
miles-ton added a commit to miles-ton/rocketmq that referenced this issue May 11, 2024
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 a pull request may close this issue.

2 participants