You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2021/02/17 18:19:44 UTC

[GitHub] [helix] jiajunwang commented on a change in pull request #1650: Improve auto enter maintenance mode

jiajunwang commented on a change in pull request #1650:
URL: https://github.com/apache/helix/pull/1650#discussion_r577838791



##########
File path: helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
##########
@@ -193,15 +193,19 @@ public Object call() {
   }
 
   // Check whether the offline/disabled instance count in the cluster reaches the set limit,
-  // if yes, pause the rebalancer, and throw exception to terminate rebalance cycle.
+  // if yes, auto enable maintenance mode, and use the maintenance rebalancer for this pipeline.
   private boolean validateOfflineInstancesLimit(final ResourceControllerDataProvider cache,
       final HelixManager manager) {
     int maxOfflineInstancesAllowed = cache.getClusterConfig().getMaxOfflineInstancesAllowed();
     if (maxOfflineInstancesAllowed >= 0) {
       int offlineCount = cache.getAllInstances().size() - cache.getEnabledLiveInstances().size();
       if (offlineCount > maxOfflineInstancesAllowed) {
+        // Enable maintenance mode in cache so the maintenance rebalancer is used for this pipeline
+        cache.enableMaintenanceMode();

Review comment:
       IMO, we should ensure the ZK update is done before enable it in the cache. This will help to prevent multiple potential consistency issues.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org