drcrallen commented on a change in pull request #6829: Don't force rebalance of
the whole cluster all the time
URL: https://github.com/apache/incubator-druid/pull/6829#discussion_r248127985
##########
File path:
server/src/main/java/org/apache/druid/server/coordinator/helper/DruidCoordinatorBalancer.java
##########
@@ -106,8 +108,18 @@ private void balanceTier(
return;
}
- final List<ServerHolder> toMoveFrom = Lists.newArrayList(servers);
- final List<ServerHolder> toMoveTo = Lists.newArrayList(servers);
+ // Sort order is ascending based on available size. We reverse the "from"
to shed the largest nodes first
+ final List<ServerHolder> toMoveFrom;
+ final List<ServerHolder> toMoveTo;
+
+ final int nodeLimit =
params.getCoordinatorDynamicConfig().getBalancerNodeLimit();
+ if (nodeLimit > 0) {
+ toMoveFrom = Lists.reverse(randomSortedSubList(servers, nodeLimit));
Review comment:
You are correct, I miss-read how some of the sampling stuff works.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]