Skip to content

Commit 713657f

Browse files
Fix slow assertion running in production in RoutingNodes (#88951)
This needs to be in a separate method, it's currently running in production and uses significant CPU time. Broken in #88794
1 parent 41af3cb commit 713657f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,12 @@ private RoutingNodes(RoutingTable routingTable, DiscoveryNodes discoveryNodes, b
146146
}
147147
}
148148
}
149+
assert invariant();
150+
}
151+
152+
private boolean invariant() {
149153
nodesToShards.values().forEach(RoutingNode::invariant);
154+
return true;
150155
}
151156

152157
private RoutingNodes(RoutingNodes routingNodes) {

0 commit comments

Comments
 (0)