diff --git a/build.gradle b/build.gradle index 15c29ffe929ea..00d6814b668d1 100644 --- a/build.gradle +++ b/build.gradle @@ -213,9 +213,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/72931" +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/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java b/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java index 51ebac9ba4bb5..3b6e6e6e2fb15 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskInfo.java @@ -8,7 +8,6 @@ package org.elasticsearch.tasks; -import org.elasticsearch.Version; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; @@ -104,11 +103,7 @@ public TaskInfo(StreamInput in) throws IOException { startTime = in.readLong(); runningTimeNanos = in.readLong(); cancellable = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { - cancelled = in.readBoolean(); - } else { - cancelled = false; // older versions do not report when tasks are cancelled so we just assume they aren't - } + cancelled = in.readBoolean(); assert cancellable || cancelled == false : "uncancellable task cannot be cancelled"; parentTaskId = TaskId.readFromStream(in); headers = in.readMap(StreamInput::readString, StreamInput::readString); @@ -124,9 +119,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(startTime); out.writeLong(runningTimeNanos); out.writeBoolean(cancellable); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { - out.writeBoolean(cancelled); - } // older versions do not report when tasks are cancelled anyway so it's ok just to drop this flag + out.writeBoolean(cancelled); parentTaskId.writeTo(out); out.writeMap(headers, StreamOutput::writeString, StreamOutput::writeString); } diff --git a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java index 8f0886fd3bad3..11c034074d314 100644 --- a/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java +++ b/x-pack/plugin/enrich/src/test/java/org/elasticsearch/xpack/monitoring/collector/enrich/ExecutingPolicyDocTests.java @@ -124,9 +124,7 @@ public void testToXContent() throws IOException { + "," + "\"cancellable\":" + executingPolicy.getTaskInfo().isCancellable() - + (executingPolicy.getTaskInfo().isCancellable() - ? ",\"cancelled\":" + executingPolicy.getTaskInfo().isCancellable() - : "") + + (executingPolicy.getTaskInfo().isCancellable() ? ",\"cancelled\":" + executingPolicy.getTaskInfo().isCancelled() : "") + "," + header.map(entry -> String.format(Locale.ROOT, "\"headers\":{\"%s\":\"%s\"}", entry.getKey(), entry.getValue())) .orElse("\"headers\":{}")