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] In the case of single-replica synchronous disk flushing, messages may be lost during a crash #8239

Closed
3 tasks done
RongtongJin opened this issue Jun 1, 2024 · 0 comments · Fixed by #8240
Closed
3 tasks done

Comments

@RongtongJin
Copy link
Contributor

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

All platforms

RocketMQ version

All versions

JDK Version

Not related to the JDK version

Describe the Bug

image
As shown in the image, the consumer might read unflushed messages, leading to premature consumption and a forward shift of the consumption offset. After a crash, the consumeQueue may roll back, and new messages could have a chance of not being consumed.

Steps to Reproduce

In a single-replica scenario with synchronous disk flushing configured, send a message and perform a crash test to check for message loss.

What Did You Expect to See?

No Messages lost.

What Did You See Instead?

Messages lost.

Additional Context

Under the condition of synchronous disk flushing, unflushed messages should be unacknowledged messages. Such messages should not be consumed prematurely, as this would lead to the consumption offset moving forward, resulting in potential phantom reads or message loss on the consumer side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant