Skip to content

Commit f8f0673

Browse files
committed
Complete backport of elastic#72931
Adjusts wire-compat and re-enables BWC tests
1 parent bf23f76 commit f8f0673

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ tasks.register("verifyVersions") {
213213
* after the backport of the backcompat code is complete.
214214
*/
215215

216-
boolean bwc_tests_enabled = false
216+
boolean bwc_tests_enabled = true
217217
// place a PR link here when committing bwc changes:
218-
String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/72931"
218+
String bwc_tests_disabled_issue = ""
219219
/*
220220
* FIPS 140-2 behavior was fixed in 7.11.0. Before that there is no way to run elasticsearch in a
221221
* JVM that is properly configured to be in fips mode with BCFIPS. For now we need to disable

server/src/main/java/org/elasticsearch/tasks/TaskInfo.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
package org.elasticsearch.tasks;
1010

11-
import org.elasticsearch.Version;
1211
import org.elasticsearch.common.ParseField;
1312
import org.elasticsearch.common.Strings;
1413
import org.elasticsearch.common.bytes.BytesReference;
@@ -104,11 +103,7 @@ public TaskInfo(StreamInput in) throws IOException {
104103
startTime = in.readLong();
105104
runningTimeNanos = in.readLong();
106105
cancellable = in.readBoolean();
107-
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
108-
cancelled = in.readBoolean();
109-
} else {
110-
cancelled = false; // older versions do not report when tasks are cancelled so we just assume they aren't
111-
}
106+
cancelled = in.readBoolean();
112107
assert cancellable || cancelled == false : "uncancellable task cannot be cancelled";
113108
parentTaskId = TaskId.readFromStream(in);
114109
headers = in.readMap(StreamInput::readString, StreamInput::readString);
@@ -124,9 +119,7 @@ public void writeTo(StreamOutput out) throws IOException {
124119
out.writeLong(startTime);
125120
out.writeLong(runningTimeNanos);
126121
out.writeBoolean(cancellable);
127-
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
128-
out.writeBoolean(cancelled);
129-
} // older versions do not report when tasks are cancelled anyway so it's ok just to drop this flag
122+
out.writeBoolean(cancelled);
130123
parentTaskId.writeTo(out);
131124
out.writeMap(headers, StreamOutput::writeString, StreamOutput::writeString);
132125
}

0 commit comments

Comments
 (0)