pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix][broker] fix ack with txn compute ackedCount error

Open congbobo184 opened this issue 3 years ago • 0 comments

issue: reproduce:

  1. redeliver one consumer received message of a batch message, will remove this message from this consumer pending acks
  2. if this message is removed and doesn't redeliver to another consumer or this consumer, we ack another message in the same batch
  3. to compute the consumer unackedCount will get an incorrect batch size, because the message don't in any consumer pending acks

Motivation

get correct batch size to compute the consumer unackedCount

Modification

use the correct batch size from the messageIdDate

Verifying this change

add the test

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

congbobo184 avatar Aug 09 '22 10:08 congbobo184

@congbobo184 Please provide a correct documentation label for your PR. Instructions see Pulsar Documentation Label Guide.

github-actions[bot] avatar Aug 15 '22 04:08 github-actions[bot]

@Technoboy- transaction ack command will carry the batchSize, if the batchSize is not in pendingAcks(the message redeliver hasn't been sent to any consumer), we will not get the correct batch size. So I think in Transaction ack, we uniformly use command carried batch size is ok

congbobo184 avatar Aug 16 '22 01:08 congbobo184

@Technoboy- Ping @congbobo184 Please resolve the conflicts.

Jason918 avatar Aug 27 '22 09:08 Jason918

@Technoboy- Ping @congbobo184 Please resolve the conflicts.

Jason918 avatar Aug 27 '22 09:08 Jason918