hangc0276 commented on code in PR #21096:
URL: https://github.com/apache/pulsar/pull/21096#discussion_r1314799406


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/bookie/rackawareness/IsolatedBookieEnsemblePlacementPolicy.java:
##########
@@ -179,25 +188,26 @@ private static Pair<Set<String>, Set<String>> 
getIsolationGroup(
         return pair;
     }
 
-    private Set<BookieId> getExcludedBookiesWithIsolationGroups(int 
ensembleSize,
+    @VisibleForTesting
+    Set<BookieId> getExcludedBookiesWithIsolationGroups(int ensembleSize,
         Pair<Set<String>, Set<String>> isolationGroups) {
         Set<BookieId> excludedBookies = new HashSet<>();
-        if (isolationGroups != null && 
isolationGroups.getLeft().contains(PULSAR_SYSTEM_TOPIC_ISOLATION_GROUP))  {
+        if (isolationGroups != null && 
isolationGroups.getLeft().contains(PULSAR_SYSTEM_TOPIC_ISOLATION_GROUP)) {
             return excludedBookies;
         }
         try {
             if (bookieMappingCache != null) {
-                CompletableFuture<Optional<BookiesRackConfiguration>> future =
-                        
bookieMappingCache.get(BookieRackAffinityMapping.BOOKIE_INFO_ROOT_PATH);
+                
bookieMappingCache.get(BookieRackAffinityMapping.BOOKIE_INFO_ROOT_PATH)
+                        .thenAccept(opt -> cachedRackConfiguration = 
opt.orElse(null)).exceptionally(e -> {
+                            log.warn("Failed to update the newest bookies rack 
config.");

Review Comment:
   Change the log msg to `log.warn("Failed to update the newest bookies rack 
config, and use the cached rack configuration: {}", cachedRackConfiguration)`



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