sourabhaggrawal opened a new issue #11972:
URL: https://github.com/apache/pulsar/issues/11972
**Describe the bug**
We are trying to configure rack-aware policy, when starting pulsar we get
this error at RackAwareEnsemblePlacementPolicyImpl and then it end up using
default-rack as per the logs.
18:10:36.083 [pulsar-ordered-OrderedExecutor-0-0] ERROR
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Failed to
initialize DNS Resolver
org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping, used default subnet
resolver : java.lang.RuntimeException: java.lang.NullPointerException
java.lang.NullPointerException
18:10:36.087 [pulsar-ordered-OrderedExecutor-0-0] INFO
org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicyImpl - Initialize
rackaware ensemble placement policy @ <Bookie:192.168.1.7:0> @ /default-rack :
org.apache.bookkeeper.client.TopologyAwareEnsemblePlacementPolicy$DefaultResolver.
**To Reproduce**
Steps to reproduce the behavior:
1. Enable bookkeeperClientRackawarePolicyEnabled in pulsar broker.conf
2. Configure
ensemblePlacementPolicy=org.apache.bookkeeper.client.RackawareEnsemblePlacementPolicy
in bookkeeper.conf
3. configure racks
4. start zookeeper, bookkeeper & pulsar
**Expected behavior**
Expected RackawareEnsemblePlacementPolicyImpl to initialise racks with given
rack info and its bookies as per the implementation of
ZKBookieRackAffinityMapping.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: iOS
- Pulsar 2.8.0
- Bookkeeper 4.14.1
**Additional context**
While troubleshooting we found, during initialisation of
RackAwareEnsemblePlacementPolicy it creates new instance of dnsResolver as
below at line
https://github.com/apache/bookkeeper/blob/97818f5123999396e66f5246420d3c7e3d25f53d/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/RackawareEnsemblePlacementPolicyImpl.java#L262
dnsResolver = ReflectionUtils.newInstance(dnsResolverName,
DNSToSwitchMapping.class);
if (dnsResolver instanceof Configurable) {
((Configurable) dnsResolver).setConf(conf);
}
setConf is then triggered on ZKBookieRackAffinityMapping which throws
NullPointer at
https://github.com/apache/pulsar/blob/89ac98e4af363b09f2fe8e309539b0e35243aaee/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZkBookieRackAffinityMapping.java#L97
while prepare rack with its host information.
--
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]