Repository: helix Updated Branches: refs/heads/master 923002e8e -> a6863937c
Add warn log when Helix controller puts a cluster into maintenance mode. Project: http://git-wip-us.apache.org/repos/asf/helix/repo Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/ce167f54 Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/ce167f54 Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/ce167f54 Branch: refs/heads/master Commit: ce167f544ab4e8cfb4229b3ad585f6c725c43771 Parents: 923002e Author: Lei Xia <[email protected]> Authored: Tue Aug 21 10:36:33 2018 -0700 Committer: Junkai Xue <[email protected]> Committed: Mon Oct 29 13:47:49 2018 -0700 ---------------------------------------------------------------------- .../helix/controller/stages/BestPossibleStateCalcStage.java | 6 ++++-- .../helix/controller/stages/IntermediateStateCalcStage.java | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/helix/blob/ce167f54/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java ---------------------------------------------------------------------- diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java b/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java index 5cc9593..2000bec 100644 --- a/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java +++ b/helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java @@ -160,16 +160,18 @@ public class BestPossibleStateCalcStage extends AbstractBaseStage { int offlineCount = cache.getAllInstances().size() - cache.getEnabledLiveInstances().size(); if (offlineCount > maxOfflineInstancesAllowed) { String errMsg = String.format( - "Offline Instances count %d greater than allowed count %d. Stop rebalance pipeline and pause the cluster %s", + "Offline Instances count %d greater than allowed count %d. Stop rebalance and put the cluster %s into maintenance mode.", offlineCount, maxOfflineInstancesAllowed, cache.getClusterName()); if (manager != null) { if (manager.getHelixDataAccessor() .getProperty(manager.getHelixDataAccessor().keyBuilder().maintenance()) == null) { manager.getClusterManagmentTool() .enableMaintenanceMode(manager.getClusterName(), true, errMsg); + LogUtil.logWarn(logger, _eventId, errMsg); } } else { - LogUtil.logError(logger, _eventId, "Failed to pause cluster, HelixManager is not set!"); + LogUtil.logError(logger, _eventId, "Failed to put cluster " + cache.getClusterName() + + " into maintenance mode, HelixManager is not set!"); } if (!cache.isTaskCache()) { updateRebalanceStatus(true, manager, cache, clusterStatusMonitor, errMsg); http://git-wip-us.apache.org/repos/asf/helix/blob/ce167f54/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java ---------------------------------------------------------------------- diff --git a/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java b/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java index 6d10c6f..425f6fa 100644 --- a/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java +++ b/helix-core/src/main/java/org/apache/helix/controller/stages/IntermediateStateCalcStage.java @@ -199,11 +199,12 @@ public class IntermediateStateCalcStage extends AbstractBaseStage { String errMsg = String.format( "Problem: according to this assignment, instance %s contains more " + "replicas/partitions than the maximum number allowed (%d). Pipeline will " - + "stop the rebalance and pause the cluster %s", + + "stop the rebalance and put the cluster %s into maintenance mode", instance, maxPartitionPerInstance, cache.getClusterName()); if (manager != null) { manager.getClusterManagmentTool().enableMaintenanceMode(manager.getClusterName(), true, errMsg); + LogUtil.logWarn(logger, _eventId, errMsg); } else { LogUtil.logError(logger, _eventId, "HelixManager is not set/null! Failed to pause this cluster/enable maintenance"
