more on sorted nodes when allocating shards above average number of shards per node

This commit is contained in:
kimchy 2010-08-21 19:55:38 +03:00
parent 76e1a6b1bf
commit 2865ceef85
1 changed files with 1 additions and 1 deletions

View File

@ -270,7 +270,7 @@ public class ShardsRoutingStrategy extends AbstractComponent {
} }
} }
// go over the nodes and try and allocate the remaining ones // go over the nodes and try and allocate the remaining ones
for (RoutingNode routingNode : routingNodes.nodesToShards().values()) { for (RoutingNode routingNode : routingNodes.sortedNodesLeastToHigh()) {
if (routingNode.canAllocate(routingNodes) && routingNode.canAllocate(shard)) { if (routingNode.canAllocate(routingNodes) && routingNode.canAllocate(shard)) {
changed = true; changed = true;
routingNode.add(shard); routingNode.add(shard);