jiajunwang commented on a change in pull request #690: Reset the WAGED
rebalancer once the controller newly acquires leadership.
URL: https://github.com/apache/helix/pull/690#discussion_r370779423
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
##########
@@ -282,22 +263,22 @@ private boolean validateOfflineInstancesLimit(final
ResourceControllerDataProvid
Map<String, IdealState> newIdealStates = new HashMap<>();
- ClusterConfig clusterConfig = cache.getClusterConfig();
- WagedRebalancer wagedRebalancer =
- getWagedRebalancer(helixManager,
clusterConfig.getGlobalRebalancePreference(),
- clusterConfig.isGlobalRebalanceAsyncModeEnabled());
- try {
- newIdealStates.putAll(wagedRebalancer.computeNewIdealStates(cache,
wagedRebalancedResourceMap,
- currentStateOutput));
- } catch (HelixRebalanceException ex) {
- // Note that unlike the legacy rebalancer, the WAGED rebalance won't
return partial result.
- // Since it calculates for all the eligible resources globally, a
partial result is invalid.
- // TODO propagate the rebalancer failure information to
updateRebalanceStatus for monitoring.
+ if (wagedRebalancer != null) {
Review comment:
As mentioned above, I would prefer to reject call (by throwing exceptions or
so) inside the rebalancer. For the calc stage, there is nothing it can do.
Moreover, checking inside the rebalancer can help to keep the close status
private.
TODO added.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]