Check that all active shards have their allocation id in the in-sync set

This commit is contained in:
Yannick Welsch 2016-08-19 10:04:42 +02:00
parent a4ea7e7223
commit a74f77b632

View File

@ -128,6 +128,11 @@ public class IndexRoutingTable extends AbstractDiffable<IndexRoutingTable> imple
throw new IllegalStateException("shard routing has an index [" + shardRouting.index() + "] that is different " + throw new IllegalStateException("shard routing has an index [" + shardRouting.index() + "] that is different " +
"from the routing table"); "from the routing table");
} }
if (shardRouting.active() &&
indexMetaData.activeAllocationIds(shardRouting.id()).contains(shardRouting.allocationId().getId()) == false) {
throw new IllegalStateException("active shard routing " + shardRouting + " has no corresponding entry in the " +
"in-sync allocation set " + indexMetaData.activeAllocationIds(shardRouting.id()));
}
} }
} }
return true; return true;