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 2019/10/17 06:14:34 UTC

[GitHub] [helix] pkuwm commented on a change in pull request #514: The WAGED rebalancer returns the previously calculated assignment on calculation failure

pkuwm commented on a change in pull request #514: The WAGED rebalancer returns the previously calculated assignment on calculation failure
URL: https://github.com/apache/helix/pull/514#discussion_r335821471
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/WagedRebalancer.java
 ##########
 @@ -174,9 +175,33 @@ public void close() {
     LOG.info("Start computing new ideal states for resources: {}", resourceMap.keySet().toString());
     validateInput(clusterData, resourceMap);
 
-    // Calculate the target assignment based on the current cluster status.
-    Map<String, IdealState> newIdealStates =
-        computeBestPossibleStates(clusterData, resourceMap, currentStateOutput);
+    Map<String, IdealState> newIdealStates;
+    try {
+      // Calculate the target assignment based on the current cluster status.
+      newIdealStates = computeBestPossibleStates(clusterData, resourceMap, currentStateOutput);
+    } catch (HelixRebalanceException ex) {
+      LOG.error("The new assignment calculation fails.", ex);
+      // Record the failure in metrics.
+      CountMetric rebalanceFailureCount = _metricCollector.getMetric(
+          WagedRebalancerMetricCollector.WagedRebalancerMetricNames.RebalanceFailureCount.name(),
+          CountMetric.class);
+      rebalanceFailureCount.increaseCount(1l);
 
 Review comment:
   Nit: maybe `1l` -> `1L` is preferred.

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


With regards,
Apache Git Services

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