[feat][pip] PIP-426: Enable Consumer Throttling and Accurate Unacknowledged Message Tracking for Exclusive and Failover Subscriptions#24396
Conversation
…onsumer.java Co-authored-by: Lari Hotari <lhotari@users.noreply.github.com>
…ng in cumulative ack mode.
…g_and_cumulative_unacked_stats # Conflicts: # pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherSingleActiveConsumerTest.java
lhotari
left a comment
There was a problem hiding this comment.
The changes make sense to me, but since this changes the behavior of the existing way exclusive and failover subscriptions currently behave, it will be necessary to write a PIP for this change. One common request has been that when behavior is changed that there's a feature flag which controls whether the old or new behavior is used.
Keeping pending acks state comes with a cost, so that's one reason why it might be useful to turn this feature off to avoid instability when upgrading an existing system.
You could use LLM to draft a PIP by passing
- https://github.com/apache/pulsar/blob/master/pip/README.md
- https://github.com/apache/pulsar/blob/master/pip/TEMPLATE.md
- some example PIPs (such as PIP-379 or PIP-393)
- background issue text and PR description
- PR diff
to the context using a similar approach as https://gist.github.com/lhotari/81f533af4b9ad515e02d96e543c4408b.
After having a draft PIP document, it's easy to revisit it to get it right. Obviously you can just do it manually too. :)
Even before writing a PIP, it could be useful to ask whether this type of change would be acceptable in the community. However, having the PIP document to collect the background could be useful already at this stage. The initial discussion happens on the Pulsar dev mailing list (joining instructions).
Fixes #24159
Main Issue: #24159
Motivation
We can reproduce flow control issue by this unit test
Modifications
pendingAcksmechanism in theConsumerclass to support exclusive and failover subscriptions.pendingAcksonly works in individual ack mode.PendingAckHandleImplfor transaction support after removing the dependency onSubscription.isIndividualAckMode.Verifying this change
This change is already covered by existing tests, such as (please describe tests).
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: