Skip to content

Commit 15607b1

Browse files
SwethaGupthaSwetha Guptha
andauthored
Downgrade version to 2.18.0 for ser/de of new ClusterStatsRequest metric params. (#16441)
Signed-off-by: Swetha Guptha <[email protected]> Co-authored-by: Swetha Guptha <[email protected]>
1 parent bb1359f commit 15607b1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/ClusterStatsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public class ClusterStatsIT extends AbstractRollingTestCase {
2626
public void testClusterStats() throws IOException {
2727
Response response = client().performRequest(new Request("GET", "/_cluster/stats"));
2828
validateClusterStatsWithFilterResponse(response, nodeStatsMetrics, indicesStatsMetrics);
29-
if (AbstractRollingTestCase.UPGRADE_FROM_VERSION.onOrAfter(Version.V_3_0_0) || (
30-
CLUSTER_TYPE == ClusterType.UPGRADED && Version.CURRENT.onOrAfter(Version.V_3_0_0))) {
29+
if (AbstractRollingTestCase.UPGRADE_FROM_VERSION.onOrAfter(Version.V_2_18_0) || (
30+
CLUSTER_TYPE == ClusterType.UPGRADED && Version.CURRENT.onOrAfter(Version.V_2_18_0))) {
3131
response = client().performRequest(new Request("GET", "/_cluster/stats/os/nodes/_all"));
3232
validateClusterStatsWithFilterResponse(response, List.of("os"), Collections.emptyList());
3333
response = client().performRequest(new Request("GET", "/_cluster/stats/indices/mappings/nodes/_all"));

server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public ClusterStatsRequest(StreamInput in) throws IOException {
5959
if (in.getVersion().onOrAfter(Version.V_2_16_0)) {
6060
useAggregatedNodeLevelResponses = in.readOptionalBoolean();
6161
}
62-
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
62+
if (in.getVersion().onOrAfter(Version.V_2_18_0)) {
6363
computeAllMetrics = in.readOptionalBoolean();
6464
final long longMetricsFlags = in.readLong();
6565
for (Metric metric : Metric.values()) {
@@ -135,7 +135,7 @@ public void writeTo(StreamOutput out) throws IOException {
135135
if (out.getVersion().onOrAfter(Version.V_2_16_0)) {
136136
out.writeOptionalBoolean(useAggregatedNodeLevelResponses);
137137
}
138-
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
138+
if (out.getVersion().onOrAfter(Version.V_2_18_0)) {
139139
out.writeOptionalBoolean(computeAllMetrics);
140140
long longMetricFlags = 0;
141141
for (Metric metric : requestedMetrics) {
@@ -154,7 +154,7 @@ public void writeTo(StreamOutput out) throws IOException {
154154
* An enumeration of the "core" sections of metrics that may be requested
155155
* from the cluster stats endpoint.
156156
*/
157-
@PublicApi(since = "3.0.0")
157+
@PublicApi(since = "2.18.0")
158158
public enum Metric {
159159
OS("os", 0),
160160
JVM("jvm", 1),
@@ -192,7 +192,7 @@ public int getIndex() {
192192
*
193193
* When no value is provided for param index_metric, default filter is set to _all.
194194
*/
195-
@PublicApi(since = "3.0.0")
195+
@PublicApi(since = "2.18.0")
196196
public enum IndexMetric {
197197
// Metrics computed from ShardStats
198198
SHARDS("shards", 0),

0 commit comments

Comments
 (0)