From eff46fb9308f3b68125b0d4bc429fcb4c0a32958 Mon Sep 17 00:00:00 2001 From: Sarat Vemulapalli Date: Fri, 5 Mar 2021 11:22:35 -0800 Subject: [PATCH] Fixing transport deserialization with oss distribution (#218) Signed-off-by: Sarat Vemulapalli Signed-off-by: Peter Nied --- server/src/main/java/org/elasticsearch/Build.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/Build.java b/server/src/main/java/org/elasticsearch/Build.java index 43b2656bf6b..472b7e8c87a 100644 --- a/server/src/main/java/org/elasticsearch/Build.java +++ b/server/src/main/java/org/elasticsearch/Build.java @@ -186,7 +186,10 @@ public class Build { final Type type; // The following block is kept for existing BWS tests to pass. // TODO - clean up this code when we remove all v6 bwc tests. - if (in.getVersion().onOrAfter(Version.V_6_3_0) && in.getVersion().onOrBefore(Version.V_7_0_0)) { + // TODO - clean this up when OSS flavor is removed in all of the code base + // (Integ test zip still write OSS as distribution) + // See issue: https://github.com/opendistro-for-elasticsearch/search/issues/159 + if (in.getVersion().onOrAfter(Version.V_6_3_0)) { flavor = in.readString(); } if (in.getVersion().onOrAfter(Version.V_6_3_0)) { @@ -211,7 +214,9 @@ public class Build { public static void writeBuild(Build build, StreamOutput out) throws IOException { // The following block is kept for existing BWS tests to pass. // TODO - clean up this code when we remove all v6 bwc tests. - if (out.getVersion().onOrAfter(Version.V_6_3_0) && out.getVersion().onOrBefore(Version.V_7_0_0)) { + // TODO - clean this up when OSS flavor is removed in all of the code base + // See issue: https://github.com/opendistro-for-elasticsearch/search/issues/159 + if (out.getVersion().onOrAfter(Version.V_6_3_0)) { out.writeString("oss"); } if (out.getVersion().onOrAfter(Version.V_6_3_0)) {