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 9 months ago • 2 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 Mar 19 '25 14:03 poorbarcode

Rebased master branch

poorbarcode avatar Mar 21 '25 04:03 poorbarcode

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

poorbarcode avatar Jun 12 '25 16:06 poorbarcode

Pushed a new PR to instead the current one

  • https://github.com/apache/pulsar/pull/24496

poorbarcode avatar Jul 09 '25 14:07 poorbarcode

closing this one since it has been replaced by #24496

lhotari avatar Oct 13 '25 08:10 lhotari