horizonzy opened a new issue, #18673:
URL: https://github.com/apache/pulsar/issues/18673

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   Pulsar: master
   
   ### Minimal reproduce step
   
   1.Start bookie server with config property:
   ```bookieId=node1```.
   2.Then start pulsar with bookkeeper config: 
```reppDnsResolverClass=org.apache.pulsar.zookeeper.ZkBookieRackAffinityMapping```
   3. The pulsar didn't parse the rack info.
   
   Analyze:
   In pulsar, the DefaultBookieAddressResolver use `PulsarRegistrationClient`, 
when DefaultBookieAddressResolver resolve, it invoke 
`PulsarRegistrationClient#getBookieServiceInfo`.
   
https://github.com/apache/bookkeeper/blob/8fce024989ea0427877cb8981fcb94f7afadc3c7/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/DefaultBookieAddressResolver.java#L41-L72
   
   PulsarRegistrationClient didn't override the getBookieServiceInfo, 
   ```
       default CompletableFuture<Versioned<BookieServiceInfo>> 
getBookieServiceInfo(BookieId bookieId) {
           try {
               BookieServiceInfo bookieServiceInfo = BookieServiceInfoUtils
                       .buildLegacyBookieServiceInfo(bookieId.toString());
               return FutureUtils.value(new Versioned<>(bookieServiceInfo, new 
LongVersion(-1)));
           } catch (UnknownHostException e) {
               return FutureUtils.exception(e);
           }
       }
   ```
   If the param bookieId is not match format `IP:Port`, it will throw an 
exception. 
   It will step down to default rack info.
   
   ### What did you expect to see?
   
   The pulsar parse rack info correctly.
   
   ### What did you see instead?
   
   The pulsar parse rack info incorrectly.
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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]

Reply via email to