Skip to content

[Bug] Prevent premature offset commit before consumer record flush #9626

@lizhimins

Description

@lizhimins

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

Linux 5.10

RocketMQ version

5.2-5.3.3

JDK Version

JDK11

Describe the Bug

It is a concurrency issue: when thread A tries to remove data from the cache, the records have not yet been flushed to disk. If thread B attempts to fetch the minimum offset from the cache and commit it at the same time, any unflushed records may be lost in the event of a crash.

Steps to Reproduce

It is a concurrency issue: when thread A tries to remove data from the cache, the records have not yet been flushed to disk. If thread B attempts to fetch the minimum offset from the cache and commit it at the same time, any unflushed records may be lost in the event of a crash.

What Did You Expect to See?

Prevent premature offset commit before consumer record flush

What Did You See Instead?

consumer record flush then commit min offset

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions