From cc5531bcff90bd500cd7c0e47f41fd87b1b27130 Mon Sep 17 00:00:00 2001 From: gargharsh3134 <51459091+gargharsh3134@users.noreply.github.com> Date: Thu, 19 Sep 2024 01:37:03 +0530 Subject: [PATCH] Use local clusterState call during healthchecks (#8187) * Use local clusterState call during healthchecks Signed-off-by: Harsh Garg * Adding changeLog Signed-off-by: Harsh Garg --------- Signed-off-by: Harsh Garg Co-authored-by: Harsh Garg Co-authored-by: Ashwin P Chandran --- changelogs/fragments/8187.yml | 2 ++ .../opensearch/version_check/ensure_opensearch_version.ts | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/8187.yml diff --git a/changelogs/fragments/8187.yml b/changelogs/fragments/8187.yml new file mode 100644 index 000000000000..3efe2b914dfa --- /dev/null +++ b/changelogs/fragments/8187.yml @@ -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)) \ No newline at end of file diff --git a/src/core/server/opensearch/version_check/ensure_opensearch_version.ts b/src/core/server/opensearch/version_check/ensure_opensearch_version.ts index fc35818e2929..cbcf6ae47587 100644 --- a/src/core/server/opensearch/version_check/ensure_opensearch_version.ts +++ b/src/core/server/opensearch/version_check/ensure_opensearch_version.ts @@ -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;