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

Optimize the process of truncateInvalidMsg(). #6665

Closed
3 tasks done
GenerousMan opened this issue Apr 29, 2023 · 0 comments · Fixed by #6666
Closed
3 tasks done

Optimize the process of truncateInvalidMsg(). #6665

GenerousMan opened this issue Apr 29, 2023 · 0 comments · Fixed by #6666
Labels

Comments

@GenerousMan
Copy link
Contributor

GenerousMan commented Apr 29, 2023

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.

Describe the Bug

The confirmOffset is not reseted after truncating.

Steps to Reproduce

3 Controllers, 3 Brokers.

The calculating process of truncateInvalidMsg has something wrong here:

image

The reputOffset was wrongly calculated, which leads to more and more messages were truncated.

What Did You Expect to See?

No message lost.

What Did You See Instead?

image

Additional Context

The reputFromOffset is re-calculated here:
image

It uses confirmOffset:
image
image

The reputFromOffset is reseted, but the confirmOffset is not reseted:
image

RongtongJin pushed a commit that referenced this issue May 4, 2023
* 1. Fix the bug that confirmOffset may be larger than ReputOffset in some cases. 2. Optimize the logic when truncate dirty files.

* Add more logs while expanding SyncStateSet.

* reset the confirmOffset to the truncated offset.

* optimize the log.

* move setConfirmOffset() process into commitLog.

* add the judge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant