pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix] [broker] Fix negative subscription/consumer's unack-messages

Open poorbarcode opened this issue 6 months ago • 0 comments

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-messages who actually deleted messages successfully.
  • This PR also fixes the issue of the unack-messages is 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

poorbarcode avatar Jul 09 '25 14:07 poorbarcode