From 76e1a6b1bf7588970c5a0ac896e06299e5fbbf1f Mon Sep 17 00:00:00 2001 From: kimchy Date: Sat, 21 Aug 2010 19:51:14 +0300 Subject: [PATCH] check also for negative values --- .../cluster/routing/strategy/ShardsRoutingStrategy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/strategy/ShardsRoutingStrategy.java b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/strategy/ShardsRoutingStrategy.java index 475b3cc30be..a7d39ae686a 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/strategy/ShardsRoutingStrategy.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/strategy/ShardsRoutingStrategy.java @@ -247,7 +247,7 @@ public class ShardsRoutingStrategy extends AbstractComponent { if (node.canAllocate(routingNodes) && node.canAllocate(shard)) { int numberOfShardsToAllocate = routingNodes.requiredAverageNumberOfShardsPerNode() - node.shards().size(); - if (numberOfShardsToAllocate == 0) { + if (numberOfShardsToAllocate <= 0) { continue; }