mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-08 03:49:38 +00:00
[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);
|
||||
unassignedNodesExecludingPrimary.remove(newNode(0).getId());
|
||||
primaryNode = selectAndRemove(unassignedNodesExecludingPrimary);
|
||||
unassignedNodes.remove(primaryNode);
|
||||
}
|
||||
if (primaryState == ShardRoutingState.RELOCATING) {
|
||||
relocatingNode = selectAndRemove(unassignedNodes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user