From 96e44f07eb81590cfebe9c7e4751400b106bd437 Mon Sep 17 00:00:00 2001 From: Sagar <99425694+sgup432@users.noreply.github.com> Date: Wed, 24 May 2023 07:48:36 -0700 Subject: [PATCH] Task cancellation API version guard fix (#7712) Signed-off-by: Sagar Upadhyaya --- server/src/main/java/org/opensearch/tasks/TaskInfo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/tasks/TaskInfo.java b/server/src/main/java/org/opensearch/tasks/TaskInfo.java index 2e5415279d804..d66647d134d43 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskInfo.java +++ b/server/src/main/java/org/opensearch/tasks/TaskInfo.java @@ -185,7 +185,7 @@ public TaskInfo(StreamInput in) throws IOException { } else { resourceStats = null; } - if (in.getVersion().onOrAfter(Version.V_3_0_0)) { + if (in.getVersion().onOrAfter(Version.V_2_8_0)) { cancellationStartTime = in.readOptionalLong(); } else { cancellationStartTime = null; @@ -210,7 +210,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getVersion().onOrAfter(Version.V_2_1_0)) { out.writeOptionalWriteable(resourceStats); } - if (out.getVersion().onOrAfter(Version.V_3_0_0)) { + if (out.getVersion().onOrAfter(Version.V_2_8_0)) { out.writeOptionalLong(cancellationStartTime); } }