From f238a0c9010616530bbb5cb970140e808d2f8056 Mon Sep 17 00:00:00 2001 From: Keith Massey Date: Wed, 28 Jul 2021 09:35:17 -0500 Subject: [PATCH] Re-enabling BWC tests, and updating supported versions for shard count feature after backport --- build.gradle | 4 ++-- .../test/nodes.stats/11_indices_metrics.yml | 12 ++++++------ .../action/admin/indices/stats/CommonStats.java | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 7cad5e8a11deb..7dd5e75b188b7 100644 --- a/build.gradle +++ b/build.gradle @@ -145,9 +145,9 @@ tasks.register("verifyVersions") { * after the backport of the backcompat code is complete. */ -boolean bwc_tests_enabled = false +boolean bwc_tests_enabled = true // place a PR link here when committing bwc changes: -String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/75760" +String bwc_tests_disabled_issue = "" /* * FIPS 140-2 behavior was fixed in 7.11.0. Before that there is no way to run elasticsearch in a * JVM that is properly configured to be in fips mode with BCFIPS. For now we need to disable diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml index 3824d2eaa1604..1ef7e81bf16df 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml @@ -324,8 +324,8 @@ "Metric - blank for indices shards": - skip: features: [arbitrary_key] - version: " - 7.99.99" - reason: "total shard count added in version 8.0" + version: " - 7.14.99" + reason: "total shard count added in version 7.15.0" - do: nodes.info: {} - set: @@ -341,8 +341,8 @@ "Metric - _all for indices shards": - skip: features: [arbitrary_key] - version: " - 7.99.99" - reason: "total shard count added in version 8.0" + version: " - 7.14.99" + reason: "total shard count added in version 7.15.0" - do: nodes.info: {} - set: @@ -360,8 +360,8 @@ - skip: features: ["allowed_warnings", arbitrary_key] - version: " - 7.99.99" - reason: "total shard count added in version 8.0" + version: " - 7.14.99" + reason: "total shard count added in version 7.15.0" - do: indices.create: diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java index 6d7cb1c0c919a..ac46228b23d08 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java @@ -257,6 +257,8 @@ public CommonStats(StreamInput in) throws IOException { recoveryStats = in.readOptionalWriteable(RecoveryStats::new); if (in.getVersion().onOrAfter(Version.V_8_0_0)) { bulk = in.readOptionalWriteable(BulkStats::new); + } + if (in.getVersion().onOrAfter(Version.V_7_15_0)) { shards = in.readOptionalWriteable(ShardCountStats::new); } } @@ -281,6 +283,8 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(recoveryStats); if (out.getVersion().onOrAfter(Version.V_8_0_0)) { out.writeOptionalWriteable(bulk); + } + if (out.getVersion().onOrAfter(Version.V_7_15_0)) { out.writeOptionalWriteable(shards); } }