xyuanlu commented on code in PR #2702:
URL: https://github.com/apache/helix/pull/2702#discussion_r1402461649


##########
helix-core/src/main/java/org/apache/helix/util/HelixUtil.java:
##########
@@ -295,7 +295,7 @@ private static Map<String, ResourceAssignment> 
getAssignmentForWagedFullAutoImpl
       // For LiveInstances, we must preserve the existing session IDs
       // So read LiveInstance objects from the cluster and do a "retainAll" on 
them
       // liveInstanceMap is an unmodifiableMap instances, so we filter using a 
stream
-      Map<String, LiveInstance> liveInstanceMap = 
dataProvider.getLiveInstances();
+      Map<String, LiveInstance> liveInstanceMap = 
dataProvider.getAssignableLiveInstances();

Review Comment:
   nit: change name?



##########
helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java:
##########
@@ -239,7 +290,8 @@ private boolean validateOfflineInstancesLimit(final 
ResourceControllerDataProvid
       final HelixManager manager) {
     int maxOfflineInstancesAllowed = 
cache.getClusterConfig().getMaxOfflineInstancesAllowed();
     if (maxOfflineInstancesAllowed >= 0) {
-      int offlineCount = cache.getAllInstances().size() - 
cache.getEnabledLiveInstances().size();
+      int offlineCount =
+          cache.getAssignableInstances().size() - 
cache.getAssignableEnabledLiveInstances().size();

Review Comment:
   Here might be tricky for Evacuate. For swap, because swap-in instances are 
mirror, so it is not considered in offline limit for EMM. But Evacuate will 
reduce capacity, we may want to separate these 2 cases. 
   Not related to this change though.



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