zhaijack opened a new pull request #1527: Reduce un-necessary work when doing bundle lookup for partitioned topic URL: https://github.com/apache/incubator-pulsar/pull/1527 ### Motivation For partitioned topic, when create producer or consumer for each partition concurrently, it will call `pularclient.getConnection` and will finally call into `namespace.searchForCandidateBroker` to acquire target bundle. If this bundle contains more then one partitioned topic, then each of them will call the bundle related handling(acquire ownership, loadNamespaceTopics), this waste some resource. This change tries to let the first partition topic do the real work once, and do the piggy back for other concurrent topics handling. e.g. ``` Apr 05 01:43:25 ip-10-0-0-145.us-west-2.compute.internal pulsar[12989]: 01:43:25.301 [pulsar-1-17] INFO org.apache.pulsar.broker.namespace.OwnershipCache - Trying to acquire ownership of benchmark/ local/ns-CeV_hcU/0x14000000_0x18000000 ..... ..... Apr 05 01:43:25 ip-10-0-0-145.us-west-2.compute.internal pulsar[12989]: 01:43:25.301 [pulsar-1-10] INFO org.apache.pulsar.broker.namespace.OwnershipCache - Trying to acquire ownership of benchmark/ local/ns-CeV_hcU/0x14000000_0x18000000 Apr 05 01:43:25 ip-10-0-0-145.us-west-2.compute.internal pulsar[12989]: 01:43:25.301 [pulsar-1-15] INFO org.apache.pulsar.broker.namespace.OwnershipCache - Trying to acquire ownership of benchmark/ local/ns-CeV_hcU/0x14000000_0x18000000 Apr 05 01:43:25 ip-10-0-0-145.us-west-2.compute.internal pulsar[12989]: 01:43:25.304 [pulsar-ordered-OrderedExecutor-7-0-EventThread] INFO org.apache.pulsar.broker.namespace.OwnershipCache - Successfully acquired ownership of /namespace/benchmark/local/ns-CeV_hcU/0x14000000_0x18000000 Apr 05 01:43:25 ip-10-0-0-145.us-west-2.compute.internal pulsar[12989]: 01:43:25.304 [pulsar-ordered-OrderedExecutor-7-0-EventThread] INFO org.apache.pulsar.broker.namespace.OwnershipCache - Successfully acquired ownership of /namespace/benchmark/local/ns-CeV_hcU/0x14000000_0x18000000 ...... ``` ### Modifications This change tries to let the first partition topic do the real work only once, and do the piggy back for other concurrent topics handling. ### Result getConnection for partitioned consumer and producer would be more efficient.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services