From 8234c2a6a02c8c0cc90a45aeb082861c352357b6 Mon Sep 17 00:00:00 2001 From: Sandesh Kumar Date: Wed, 8 Feb 2023 20:23:19 -0800 Subject: [PATCH] Changing roles counting behavior --- .../admin/cluster/stats/ClusterStatsNodes.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java index b76d209a4894f..ae7570e808935 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java @@ -240,12 +240,13 @@ private Counts(final List nodeInfos) { for (DiscoveryNodeRole role : nodeInfo.getNode().getRoles()) { // TODO: Remove the 'if' condition and only keep the statement in 'else' after removing MASTER_ROLE. // As of 2.0, CLUSTER_MANAGER_ROLE is added, and it should be taken as MASTER_ROLE - if (role.isClusterManager()) { - roles.merge(DiscoveryNodeRole.MASTER_ROLE.roleName(), 1, Integer::sum); - roles.merge(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName(), 1, Integer::sum); - } else { - roles.merge(role.roleName(), 1, Integer::sum); - } +// if (role.isClusterManager()) { +// roles.merge(DiscoveryNodeRole.MASTER_ROLE.roleName(), 1, Integer::sum); +// roles.merge(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName(), 1, Integer::sum); +// } else { +// roles.merge(role.roleName(), 1, Integer::sum); +// } + roles.merge(role.roleName(), 1, Integer::sum); } } }