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/18 19:43:20 UTC

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

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



##########
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:
       It's something I also thought about. It doesn't seem too much different. If ZK update fails, a `HelixException` will be thrown and the pipeline will be terminated. Either before or after ZK update is fine. The reason I put it before is I thought the logic looks a bit more clear to me, as it enables M mode immediately right after the offline count > threshold. It does not depend on helix manager is set or not.
   
   Synced with @jiajunwang offline. He also agreed either one will work. Thanks, @jiajunwang, for the review!




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