hangc0276 opened a new pull request #9894: URL: https://github.com/apache/pulsar/pull/9894
### Motivation When using Region/Rack aware placement policy for pulsar managed ledger, we should also use those policy for bookkeeper and bookkeeper.conf should add the follow configuration. Otherwise, it the placement policy won't work for bookkeeper auto recovery. ``` ensemblePlacementPolicy=org.apache.bookkeeper.client.RegionAwareEnsemblePlacementPolicy reppDnsResolverClass=org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping ``` However, if we configured change root for Zookeeper in bookkeeper.conf, eg. ``` zkLedgersRootPath=/test-v1/ledgers zkServers=localhost:2181 ``` `/test-v1` is the change root for zookeeper. The `zkBookieRackAffinityMapping` resolver will be invalid, and all resolved result will be `null`. The reason is that `zkBookieRackAffinityMapping` initiate Zookeeper Client according to `zkServers` configured in `bookkeeper.conf`, and doesn't take change root into account. Thus it lead to get bookies placement policy from wrong place , which is `/bookies` and not the correct `/test-v1/bookies`. ### Changes 1. Check whether configured Zookeeper change root in `bookkeeper.conf` before initiate Zookeeper Client. If it configured, use the change root path to initiate Zookeeper Client. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
