codelipenghui commented on a change in pull request #13683:
URL: https://github.com/apache/pulsar/pull/13683#discussion_r781800568



##########
File path: 
pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/BookieRackAffinityMapping.java
##########
@@ -158,7 +159,9 @@ private String getRack(String bookieAddress) {
             }
         }
 
-        if (bi != null) {
+        if (bi != null
+                && !Strings.isNullOrEmpty(bi.getRack())
+                && !bi.getRack().equals("/")) {

Review comment:
       ```suggestion
           if (bi != null
                   && !Strings.isNullOrEmpty(bi.getRack())
                   && !bi.getRack().trim().equals("/")) {
   ```

##########
File path: 
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBookies.java
##########
@@ -89,12 +93,21 @@ void run() throws Exception {
 
         @Override
         void run() throws Exception {
+            checkArgument(!Strings.isNullOrEmpty(bookieRack) && 
!bookieRack.equals(PATH_SEPARATOR),

Review comment:
       ```suggestion
               checkArgument(!Strings.isNullOrEmpty(bookieRack) && 
!bookieRack.trim().equals(PATH_SEPARATOR),
   ```




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