diff --git a/helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/HealthCheck.java b/helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/HealthCheck.java index d1e7d5e5b7..5dfd862d3b 100644 --- a/helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/HealthCheck.java +++ b/helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/HealthCheck.java @@ -55,24 +55,24 @@ public enum HealthCheck { /** * Check if instance has error partitions */ - HAS_ERROR_PARTITION, - /** - * Check if all resources hosted on the instance can still meet the min active replica - * constraint if this instance is shutdown - */ - MIN_ACTIVE_REPLICA_CHECK_FAILED; + HAS_ERROR_PARTITION; /** * Pre-defined list of checks to test if an instance can be stopped at runtime. Excludes MIN_ACTIVE_REPLICA_CHECK as * that is performed separately. */ - public static List STOPPABLE_CHECK_LIST = Arrays.stream(HealthCheck.values()) - .filter(healthCheck -> healthCheck != HealthCheck.MIN_ACTIVE_REPLICA_CHECK_FAILED) - .collect(Collectors.toList()); + public static List STOPPABLE_CHECK_LIST = Arrays.asList(HealthCheck.values()); + /** * Pre-defined list of checks to test if an instance is in healthy running state */ public static List STARTED_AND_HEALTH_CHECK_LIST = ImmutableList .of(INVALID_CONFIG, INSTANCE_NOT_ALIVE, INSTANCE_NOT_ENABLED, INSTANCE_NOT_STABLE, EMPTY_RESOURCE_ASSIGNMENT); + + /** + * Check if all resources hosted on the instance can still meet the min active replica + * constraint if this instance is shutdown + */ + public static String MIN_ACTIVE_REPLICA_CHECK_FAILED = "MIN_ACTIVE_REPLICA_CHECK_FAILED"; } \ No newline at end of file diff --git a/helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/MaintenanceManagementService.java b/helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/MaintenanceManagementService.java index 036cfff13e..f2bc426042 100644 --- a/helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/MaintenanceManagementService.java +++ b/helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/MaintenanceManagementService.java @@ -816,7 +816,7 @@ private void addInstanceMinActiveReplicaCheck(Map // add to possibleToStopInstances boolean minActiveCheckResult = InstanceValidationUtil.siblingNodesActiveReplicaCheck(_dataAccessor, instanceName, possibleToStopInstances); - stoppableCheck.add(new StoppableCheck(Collections.singletonMap(HealthCheck.MIN_ACTIVE_REPLICA_CHECK_FAILED.name(), + stoppableCheck.add(new StoppableCheck(Collections.singletonMap(HealthCheck.MIN_ACTIVE_REPLICA_CHECK_FAILED, minActiveCheckResult), StoppableCheck.Category.HELIX_OWN_CHECK)); if (stoppableCheck.isStoppable()) { possibleToStopInstances.add(instanceName);