FIFO guarantees with Key_Shared subscriptions when scaling partitions and clearing backlog #25131
-
|
I am relatively new to Apache Pulsar and am experimenting to understand its behavior under some real-world scaling scenarios. I would really appreciate guidance to validate whether my understanding and design approach is correct. Requirements / Constraints:
Proposed Design:
Scenario I’m Trying to Understand
Questions:
I want to ensure I am not misunderstanding any internal guarantees or relying on behavior that is not officially supported. Thanks in advance for your help and for maintaining Pulsar |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
By default, messages will get routed based on the hash of the key. After increasing the partition count, new messages for some of the existing keys will go to added partitions.
There's explanation of Pulsar subscription type in https://pulsar.apache.org/docs/4.1.x/concepts-messaging/#subscription-types.
yes. however if new partitions have been added, there's no special support for this. It's similar to Kafka in this matter. There have been some thoughts around adding a new feature to Pulsar 5.0 to address this shortcoming.
yes. when new consumers join, the key space is repartitioned across consumers to balance the load. Outstanding unacknowledged messages will cause delivery of reassigned keys until the outstanding messages have been acknowledged. This has been improved since Pulsar 4.0.0, the docs at https://pulsar.apache.org/docs/4.1.x/concepts-messaging/#preserving-order-of-message-delivery-by-key explain more. In Pulsar 4.0.0+ this is handled at a hash level and it doesn't block all message delivery when rehashing happens. |
Beta Was this translation helpful? Give feedback.
By default, messages will get routed based on the hash of the key. After increasing the partition count, new messages for some of the existing keys will go to added partitions.
There's explanation of Pulsar subscription type in https://pulsar.apache.org/docs/4.1.x/concepts-messaging/#subscription-types.
A consumer has a subscription to a topic in Pulsar. The exclusive, failover an…