Skip to content

[Bug] Consume offset may be abnormally reset to min in LitePullConsumer #10176

@humkum

Description

@humkum

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

Euler

RocketMQ version

develop

JDK Version

JDK8

Describe the Bug

In DefaultLitePullConsumerImpl.PullTaskImpl.run(), when nextPullOffset() is called, it may return a negative value (typically -1). This happens in the
fetchConsumeOffset() → computePullFromWhereWithException() path. If the returned offset is -1, it was directly passed to the broker's pull() method,
which could cause the consumer to reset its consumption position to minOffset, re-consuming already processed messages.

Steps to Reproduce

Try to cause an OutOfMemory ERROR after LitePullConsumer firstly start

What Did You Expect to See?

The consumer consume message continuely.

What Did You See Instead?

The consumer's consume offset was reset to min.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions