junkaixue commented on code in PR #2600:
URL: https://github.com/apache/helix/pull/2600#discussion_r1309467652


##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/WagedRebalancer.java:
##########
@@ -450,22 +452,17 @@ protected Map<String, ResourceAssignment> 
emergencyRebalance(
             resourceMap.keySet());
 
     // Step 1: Check for permanent node down
-    AtomicBoolean allNodesActive = new AtomicBoolean(true);
-    
currentBestPossibleAssignment.values().parallelStream().forEach((resourceAssignment
 -> {
-      
resourceAssignment.getMappedPartitions().parallelStream().forEach(partition -> {
-        for (String instance : 
resourceAssignment.getReplicaMap(partition).keySet()) {
-          if (!activeNodes.contains(instance)) {
-            allNodesActive.set(false);
-            break;
-          }
-        }
-      });
-    }));
-
+    boolean allNodesActive = currentBestPossibleAssignment.values().stream()

Review Comment:
   Do we know the real root case? Although Atomic can block the parallel calls. 
But it should finish very fast and not generate more thread?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to