Skip to content

Commit

Permalink
Add assert for local node
Browse files Browse the repository at this point in the history
Signed-off-by: Anshu Agarwal <anshukag@amazon.com>
  • Loading branch information
Anshu Agarwal committed Feb 8, 2023
1 parent dbd57e1 commit d4c61c4
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ private void executeHealth(
ClusterHealthResponse clusterHealthResponse = getResponse(request, currentState, waitCount, TimeoutState.OK);
if (request.ensureNodeWeighedIn() && clusterHealthResponse.hasDiscoveredClusterManager()) {
DiscoveryNode localNode = clusterService.state().getNodes().getLocalNode();
assert localNode != null;
boolean weighedAway = WeightedRoutingUtils.isWeighedAway(localNode.getId(), clusterService.state());
if (weighedAway) {
listener.onFailure(new NodeWeighedAwayException("local node is weighed away"));
Expand Down

0 comments on commit d4c61c4

Please sign in to comment.