[improve][pip] PIP-426: Enhanced Consumer Throttling and Unacknowledged Message Tracking for Exclusive and Failover Subscriptions#24400
[improve][pip] PIP-426: Enhanced Consumer Throttling and Unacknowledged Message Tracking for Exclusive and Failover Subscriptions#24400berg223 wants to merge 4 commits intoapache:masterfrom
Conversation
…king for Exclusive and Failover Subscriptions
| Apache Pulsar currently lacks full support for enforcing unacknowledged message limits and consumer-side flow control in exclusive and failover subscriptions. While these mechanisms function correctly for shared subscriptions, their absence in exclusive/failover modes causes critical limitations: | ||
|
|
There was a problem hiding this comment.
Yes, I agree with this.
After having "pending acks" also for failover subscriptions, it will be easier to come up with a proper solution for #15189 . When a failover subscription changes the active consumer, it causes duplicate processing which is problematic and surprising for many applications. Failover subscription active consumer changing should be potentially handled by first "draining" the previous consumer before sending messages to the new active consumer. (The draining approach is used for Key_Shared subscriptions since Pulsar 4.0 / PIP-379)
There was a problem hiding this comment.
Yes. It's also benefit to solve similiar issues to #15189. The draining approach could also be implemented . Your comments always open my mind and point me in the right direction !
|
|
||
| # Detailed Design | ||
|
|
||
| ## Design & Implementation Details |
There was a problem hiding this comment.
Indeed, each message in a Pulsar topic can have a persistent, monotonically increasing local index, which functions much like a Kafka offset. This feature was officially introduced by Pull Request #9039, which implemented PIP-70 ("Introduce lightweight broker entry metadata").
With this local index, the number of unacknowledged messages for a consumer can be calculated with a simple subtraction:
unacked_messages = last_delivered_index - mark_delete_position
Given its reliability, considering its proven value, enabling this index by default in a future Apache Pulsar release would be reasonable.
There was a problem hiding this comment.
Thanks for more background knowledge! It's really helpful to solve origin issue #24159 . Since there is no need to add flow permits to exlusive or failover subscription (details discussion see: https://lists.apache.org/thread/glvd8lrvyll9mdtp62d34x1k38swrls1), there is no motivation except fix the origin issue. IMO, we can close this pip to keep the pip from too much useless information.
Fixes #24159
Main Issue: #24159
Motivation
Modifications
Subscription.isIndividualAckMode()restriction that limitspendingAcksusage to shared subscriptions.PendingAckHandleImplfor exclusive/failover consumers.PersistentDispatcherSingleActiveConsumerVerifying this change
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: