[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:
parent
7753420540
commit
a0ffe6ea89
|
@ -107,6 +107,7 @@ public class ClusterStateCreationUtils {
|
||||||
Set<String> unassignedNodesExecludingPrimary = new HashSet<>(unassignedNodes);
|
Set<String> unassignedNodesExecludingPrimary = new HashSet<>(unassignedNodes);
|
||||||
unassignedNodesExecludingPrimary.remove(newNode(0).getId());
|
unassignedNodesExecludingPrimary.remove(newNode(0).getId());
|
||||||
primaryNode = selectAndRemove(unassignedNodesExecludingPrimary);
|
primaryNode = selectAndRemove(unassignedNodesExecludingPrimary);
|
||||||
|
unassignedNodes.remove(primaryNode);
|
||||||
}
|
}
|
||||||
if (primaryState == ShardRoutingState.RELOCATING) {
|
if (primaryState == ShardRoutingState.RELOCATING) {
|
||||||
relocatingNode = selectAndRemove(unassignedNodes);
|
relocatingNode = selectAndRemove(unassignedNodes);
|
||||||
|
|
Loading…
Reference in New Issue