You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/01/16 01:51:19 UTC

[GitHub] drcrallen commented on a change in pull request #6829: Don't force rebalance of the whole cluster all the time

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org