add test in node allocation is there are no shards, no need to do local gateway allocation

This commit is contained in:
kimchy 2010-10-23 01:25:23 +02:00
parent f0f62ce00c
commit 3f8c03db95
1 changed files with 5 additions and 0 deletions

View File

@ -155,6 +155,11 @@ public class LocalGatewayNodeAllocation extends NodeAllocation {
continue;
}
// the index might be created, but shards not instantiated yet, ignore this state
if (indexRoutingTable.shards().isEmpty()) {
continue;
}
if (indexRoutingTable.allPrimaryShardsUnassigned()) {
// all primary are unassigned for the index, see if we can allocate it on existing nodes, if not, don't assign
Set<String> nodesIds = Sets.newHashSet();