Skip to content

Commit

Permalink
Fix slow assertion running in production in RoutingNodes (#88951)
Browse files Browse the repository at this point in the history
This needs to be in a separate method, it's currently running in production
and uses significant CPU time.

Broken in #88794
  • Loading branch information
original-brownbear authored Jul 29, 2022
1 parent 41af3cb commit 713657f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ private RoutingNodes(RoutingTable routingTable, DiscoveryNodes discoveryNodes, b
}
}
}
assert invariant();
}

private boolean invariant() {
nodesToShards.values().forEach(RoutingNode::invariant);
return true;
}

private RoutingNodes(RoutingNodes routingNodes) {
Expand Down

0 comments on commit 713657f

Please sign in to comment.