[TEST] Ensure creation of valid routing table

An additional sanity check introduced by #17821 makes some tests fail. This check verifies that
only one shard with same shard id is allocated to a node. This commit fixes a bug in
ClusterStateCreationUtils which would construct a cluster state that allocated two shards with same
id to the same node.
This commit is contained in:
Yannick Welsch 2016-05-10 19:40:19 +02:00
parent 7753420540
commit a0ffe6ea89
1 changed files with 1 additions and 0 deletions

View File

@ -107,6 +107,7 @@ public class ClusterStateCreationUtils {
Set<String> unassignedNodesExecludingPrimary = new HashSet<>(unassignedNodes);
unassignedNodesExecludingPrimary.remove(newNode(0).getId());
primaryNode = selectAndRemove(unassignedNodesExecludingPrimary);
unassignedNodes.remove(primaryNode);
}
if (primaryState == ShardRoutingState.RELOCATING) {
relocatingNode = selectAndRemove(unassignedNodes);