[fix][broker] fix ack with txn compute ackedCount error
issue: reproduce:
- redeliver one consumer received message of a batch message, will remove this message from this consumer pending acks
- if this message is removed and doesn't redeliver to another consumer or this consumer, we ack another message in the same batch
- 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 Please provide a correct documentation label for your PR. Instructions see Pulsar Documentation Label Guide.
@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
@Technoboy- Ping @congbobo184 Please resolve the conflicts.
@Technoboy- Ping @congbobo184 Please resolve the conflicts.