Skip to content

[Bug] A successful cursor reset keeps hiding the batch indexes of committed transactional ACKs on the live owner #27752

Todo

Description

@codelipenghui

Search before reporting

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes.

User environment

master (found while reviewing #27380)

Issue Description

After a seek, the owner broker keeps hiding batch indexes that committed transactions acknowledged, while a restarted owner delivers them again.

After a partial-batch transactional ACK commits, PendingAckHandleImpl.individualAckCommitCommon removes only the transaction's entry in individualAckOfTransaction. individualAckPositions, which holds the merged batch masks, is cleared only when the whole entry is deleted (PersistentSubscription.acknowledgeMessage → clearIndividualPosition). The reset path never touches it, and AbstractBaseDispatcher.filterEntriesForConsumer still applies that mask to dispatched entries. A restarted owner rebuilds the masks from the ACKs still pending, so it delivers the index.

Error messages

None.

Reproducing the issue

  1. Produce a batched entry of 4 messages to a topic with a Shared subscription.
  2. Acknowledge batch index 0 in a transaction and commit it.
  3. Seek the subscription to earliest.
  4. Reconnect a consumer to the same owner broker: index 0 is not delivered. After an owner restart, it is.

Additional information

A successful reset should drop the committed positions from individualAckPositions and keep only the indexes still reserved by OPEN transactions. The merged mask has to be rebuilt from those transactions' ACKs rather than cleared.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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