aloyszhang commented on a change in pull request #14248:
URL: https://github.com/apache/pulsar/pull/14248#discussion_r805225848



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/RackAwareTest.java
##########
@@ -201,5 +201,121 @@ public void 
testPlacementMinRackNumsPerWriteQuorum(boolean forceMinRackNums) thr
         }
     }
 
+    public void testRackUpdate() throws Exception {
+        // 1. reset configurations for rack-aware
+        cleanup();
+        config = new ServiceConfiguration();
+        config.setBookkeeperClientMinNumRacksPerWriteQuorum(2);
+        config.setBookkeeperClientEnforceMinNumRacksPerWriteQuorum(true);
+        setup();
+
+        // 2. test create ledger(ensemble size = 2) with only one rack
+        //   rack-0     bookie-1
+        //   rack-0     bookie-2
+        //   rack-0     bookie-3
+
+        final String group = "default";
+        for (int i = 0; i < NUM_BOOKIES / 2; i++) {
+            String bookie = bookies.get(i).getLocalAddress().toString();
+            BookieInfo bi = BookieInfo.builder()
+                    .rack("rack-0")
+                    .hostname("bookie-" + (i + 1))
+                    .build();
+            log.info("setting rack for bookie at {} -- {}", bookie, bi);
+            admin.bookies().updateBookieRackInfo(bookie, group, bi);

Review comment:
       Yes, this call is blocking, but I think this blocking is to wait for the 
request send to the broker successfully.
   The `org.apache.pulsar.broker.admin.v2.Bookies#updateBookieRackInfo` is a 
method with `void`  result, so the Admin CLI doesn't wait for all the 
operations finished on the broker side.




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