Skip to content

Commit 3d20c89

Browse files
[Bug] Fix InboundDecoder version compat check (#2570) (#2573)
Change InboundDecoder ensureVersionCompatibility check for onOrAfter V_2_0_0 instead of explicit version check. This way bug fix and minor versions will correctly handshake in a mixed 1.x Cluster. Signed-off-by: Nicholas Walter Knize <nknize@apache.org> (cherry picked from commit 511ac88)
1 parent 3c64e30 commit 3d20c89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/opensearch/transport/InboundDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static IllegalStateException ensureVersionCompatibility(Version remoteVersion, V
217217
// handshake. This looks odd but it's required to establish the connection correctly we check for real compatibility
218218
// once the connection is established
219219
final Version compatibilityVersion = isHandshake ? currentVersion.minimumCompatibilityVersion() : currentVersion;
220-
if ((currentVersion.equals(Version.V_2_0_0) && remoteVersion.equals(Version.fromId(6079999))) == false
220+
if ((currentVersion.onOrAfter(Version.V_2_0_0) && remoteVersion.equals(Version.fromId(6079999))) == false
221221
&& remoteVersion.isCompatible(compatibilityVersion) == false) {
222222
final Version minCompatibilityVersion = isHandshake ? compatibilityVersion : compatibilityVersion.minimumCompatibilityVersion();
223223
String msg = "Received " + (isHandshake ? "handshake " : "") + "message from unsupported version: [";

0 commit comments

Comments
 (0)