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

Fix batched messages not ACKed correctly when batch index ACK is disabled #994

Merged

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Mar 18, 2023

Fixes #993

Motivation

When batch index ACK is disabled, if N messages in a batch are acknowledged, currently only the batched message ID of the last message will be acknowledged. This behavior is wrong because we need to acknowledge the whole batch.

Modifications

  • Create a new trackingMessageID that has no batch index and size fields for this case
  • Add TestConsumerBatchIndexAckDisabled to cover this case

…bled

Fixes apache#993

### Motivation

When batch index ACK is disabled, if N messages in a batch are
acknowledged, currently only the batched message ID of the last message
will be acknowledged. This behavior is wrong because we need to
acknowledge the whole batch.

### Modifications

- Create a `messageID` instance to ACK for this case
- Add `TestConsumerBatchIndexAckDisabled` to cover this case
pulsar/consumer_partition.go Show resolved Hide resolved
@shibd shibd merged commit 04ad521 into apache:master Mar 20, 2023
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-batch-index-ack-disabled branch March 20, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Messages unacked when EnableBatchIndexAck is false
3 participants