Fix TaskInfo serialization and unmute task_list bwc test (#2766)

Fixes the version check around resourceStats serialization and unmutes the
failing bwc test.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
This commit is contained in:
Nick Knize 2022-04-05 06:25:45 -05:00 committed by GitHub
parent 21f9950806
commit 406ee36b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -1,8 +1,6 @@
---
"tasks_list test":
- skip:
version: "all"
reason: "AwaitsFix https://github.com/opensearch-project/OpenSearch/issues/2757"
features: [arbitrary_key]
- do:

View File

@ -142,7 +142,7 @@ public final class TaskInfo implements Writeable, ToXContentFragment {
}
parentTaskId = TaskId.readFromStream(in);
headers = in.readMap(StreamInput::readString, StreamInput::readString);
if (in.getVersion().onOrAfter(Version.V_2_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_1_0)) {
resourceStats = in.readOptionalWriteable(TaskResourceStats::new);
} else {
resourceStats = null;
@ -164,7 +164,7 @@ public final class TaskInfo implements Writeable, ToXContentFragment {
}
parentTaskId.writeTo(out);
out.writeMap(headers, StreamOutput::writeString, StreamOutput::writeString);
if (out.getVersion().onOrAfter(Version.V_2_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_1_0)) {
out.writeOptionalWriteable(resourceStats);
}
}