codelipenghui opened a new pull request, #19502: URL: https://github.com/apache/pulsar/pull/19502
### Motivation We cannot distribute the load of multiple topics to multiple consumers for the Failover subscription because only the first consumer will be taken if the topic is not partitioned. https://github.com/apache/pulsar/blob/950ff441da28e144bdfb71c317a9bc339d4f05b7/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java#L96-L97 So, if you subscribe with the topic list or topic regex, the first connected consumer will be the active consumer of all the topics. Kafka has a [consumer group coordinator](https://developer.confluent.io/learn-kafka/architecture/consumer-group-protocol/), which can rebalance the load. For Pulsar, we don't have a consumer group coordinator. So this PR tries to introduce a consistent hash mechanism to peek the active consumer of a topic based on the consumer name hash and the topic name hash (note: the client will use the same consumer name to subscribe to all the topics that it wants). ### Does this pull request potentially affect one of the following parts: <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> *If the box was checked, please highlight the changes* - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The threading model - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [ ] The metrics - [ ] Anything that affects deployment ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [x] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
