Skip to content

Commit

Permalink
Use local clusterState call during healthchecks (#8187)
Browse files Browse the repository at this point in the history
* Use local clusterState call during healthchecks

Signed-off-by: Harsh Garg <[email protected]>

* Adding changeLog

Signed-off-by: Harsh Garg <[email protected]>

---------

Signed-off-by: Harsh Garg <[email protected]>
Co-authored-by: Harsh Garg <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
  • Loading branch information
3 people authored Sep 18, 2024
1 parent cea39b8 commit cc5531b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8187.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Making local cluster state calls during health checks to avoid stressing cluster manager node ([#8187](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8187))
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ export const getNodeId = async (
}

/*
* Using _cluster/state/nodes to retrieve the cluster_id of each node from cluster manager node which
* is considered to be a lightweight operation to aggegrate different cluster_ids from the OpenSearch nodes.
* Using _cluster/state/nodes to retrieve the cluster_id of each node from local cluster state of the node
* which would be be a lightweight operation to aggegrate different cluster_ids from the OpenSearch nodes.
*/
const state = (await internalClient.cluster.state({
metric: 'nodes',
local: true,
filter_path: [path],
})) as ApiResponse;

Expand Down

0 comments on commit cc5531b

Please sign in to comment.