pulsar
pulsar copied to clipboard
[fix] [broker] Fix negative subscription/consumer's unack-messages
Motivation
Issue: negative unack-messages
- Consumer-1 received messages.
- Unload the topic.
- The message may be sent to consumer-2, but the consumption of consumer-1 is still in progress now.
- Consumer-1 and consumer-2 acknowledge the message concurrently.
unack-messages may be reduced twice in above scenario, you can reproduce the issue by the new test testAcknowledgeConcurrently
Modifications
- Only reduce
unack-messageswho actually deleted messages successfully. - This PR also fixes the issue of the
unack-messagesis not accurate - The current PR does not fix the same issue when enable TXN, we need a separate PR to fix it
Documentation
- [ ]
doc - [ ]
doc-required - [x]
doc-not-needed - [ ]
doc-complete
Matching PR in forked repository
PR in forked repository: x
Rebased master branch
Since there are too many other bugs that lead to the tests can not pass, and the current PR is too large to review, I will seperate the current PR to some little PRs
- [ ] https://github.com/apache/pulsar/pull/24405
- [ ] https://github.com/apache/pulsar/pull/24406
- [ ] There are others later
Pushed a new PR to instead the current one
- https://github.com/apache/pulsar/pull/24496
closing this one since it has been replaced by #24496