check also for negative values
This commit is contained in:
parent
5d2c005622
commit
76e1a6b1bf
|
@ -247,7 +247,7 @@ public class ShardsRoutingStrategy extends AbstractComponent {
|
||||||
|
|
||||||
if (node.canAllocate(routingNodes) && node.canAllocate(shard)) {
|
if (node.canAllocate(routingNodes) && node.canAllocate(shard)) {
|
||||||
int numberOfShardsToAllocate = routingNodes.requiredAverageNumberOfShardsPerNode() - node.shards().size();
|
int numberOfShardsToAllocate = routingNodes.requiredAverageNumberOfShardsPerNode() - node.shards().size();
|
||||||
if (numberOfShardsToAllocate == 0) {
|
if (numberOfShardsToAllocate <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue