Hi everyone, I updated PIP-504 and the implementation after the PR review. The original proposal ignored consumer priority when subscription order was enabled. The revised proposal keeps priority and uses subscription order to break ties.
With the option enabled, a worker that joins or reconnects at the same priority waits its turn. A higher-priority worker can still take over when it joins or reconnects. The broker setting is now called activeConsumerFailoverUseSubscriptionOrderForNonPartitionedTopics. It still defaults to false. Updated PIP: https://github.com/apache/pulsar/pull/27767 Implementation: https://github.com/apache/pulsar/pull/27730 I'd appreciate any feedback on the revised behavior. Thanks, Oneby Wang Oneby Wang <[email protected]> 于2026年11月27日周五 14:24写道: > Hi everyone, > > I'd like to discuss PIP-504, which proposes a broker option to select the > active Failover consumer in subscription order on non-partitioned topics. > > We used a Failover subscription on a single topic to elect a leader among > workers. When we added workers, consistent hashing sometimes moved > leadership away from a healthy worker. We wanted new workers to join as > standbys and take over only when it was their turn. > > The proposed setting, nonPartitionedTopicFailoverUseSubscriptionOrder, > defaults to false. When enabled, the first consumer to join stays active > while it remains connected. Standbys take over in join order regardless of > priority, and a reconnecting consumer joins last. > > I'd appreciate feedback on the scope and the config name. A broker-wide > setting is simple, but a multi-topic or regex consumer that joins every > topic first can become active on all of them. Would a topic or namespace > policy be more useful for mixed workloads? The PIP also covers a > consequence for leader election: on a persistent topic, a seek or cursor > reset can hand leadership and replay to the next standby. > > PIP: https://github.com/apache/pulsar/pull/27767 > Implementation: https://github.com/apache/pulsar/pull/27730 > > Thanks, > Oneby Wang > >
