Skip to content

[Bug] Unexpected decrement of lmq counter #10453

@imzs

Description

@imzs

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

.

RocketMQ version

.

JDK Version

.

Describe the Bug

We previously implemented an LMQ counting mechanism and have now discovered an unexpected counter underflow issue in RocksDBConsumeQueueOffsetTable.

Steps to Reproduce

When specific get* operation is called for a non-existent LMQ topic, a sentinel value -1L is placed into topicQueueMaxCqOffset without incrementing lmqCounter. However, if this topic is later deleted, removeHeapMaxCqOffset unconditionally decrements lmqCounter, causing the counter to underflow.

What Did You Expect to See?

lmqCounter should not be decremented for entries that were never actually counted.

What Did You See Instead?

.

Additional Context

.

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