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


##########
helix-core/src/main/java/org/apache/helix/util/InstanceValidationUtil.java:
##########
@@ -254,6 +255,27 @@ public static boolean hasErrorPartitions(HelixDataAccessor 
dataAccessor, String
   public static Map<String, List<String>> 
perPartitionHealthCheck(List<ExternalView> externalViews,
       Map<String, Map<String, Boolean>> globalPartitionHealthStatus, String 
instanceToBeStop,
       HelixDataAccessor dataAccessor) {
+    return perPartitionHealthCheck(externalViews, globalPartitionHealthStatus, 
instanceToBeStop,
+        dataAccessor, Collections.emptySet());
+  }
+
+  /**
+   * Get the problematic partitions on the to-be-stop instance
+   * Requirement:
+   *  If the instance and the toBeStoppedInstances are stopped and the 
partitions on them are OFFLINE,
+   *  the cluster still have enough "healthy" replicas on other sibling 
instances
+   *
+   *  - sibling instances mean those who share the same partition (replicas) 
of the to-be-stop instance
+   *
+   * @param globalPartitionHealthStatus (instance => (partition name, health 
status))
+   * @param instanceToBeStop The instance to be stopped
+   * @param dataAccessor The data accessor
+   * @param toBeStoppedInstances A set of instances presumed to be are already 
stopped

Review Comment:
   Please also mention this field need to be mutual exclusive with 
instanceToBeStop



##########
helix-core/src/main/java/org/apache/helix/util/InstanceValidationUtil.java:
##########
@@ -406,8 +449,8 @@ public static boolean 
siblingNodesActiveReplicaCheck(HelixDataAccessor dataAcces
         if (stateByInstanceMap.containsKey(instanceName)) {
           int numHealthySiblings = 0;
           for (Map.Entry<String, String> entry : 
stateByInstanceMap.entrySet()) {
-            if (!entry.getKey().equals(instanceName)
-                && !unhealthyStates.contains(entry.getValue())) {
+            if (!entry.getKey().equals(instanceName) && 
!toBeStoppedInstances.contains(

Review Comment:
   null check for `toBeStoppedInstances `?



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