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