if shard is not started, don't allow to move it

we already only run on started shards in the single place where we use move, but this is a better check in general
This commit is contained in:
Shay Banon 2012-05-30 14:11:10 +02:00
parent 5b6b94cf83
commit eb95bb50a8

View File

@ -165,7 +165,9 @@ public class EvenShardsCountAllocator extends AbstractComponent implements Shard
@Override
public boolean move(MutableShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
assert shardRouting.started();
if (!shardRouting.started()) {
return false;
}
boolean changed = false;
RoutingNode[] sortedNodesLeastToHigh = sortedNodesLeastToHigh(allocation);
if (sortedNodesLeastToHigh.length == 0) {