From 7867238bbc034b8096619b50e4c6c32538285362 Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 24 Jun 2025 18:30:11 +0100 Subject: [PATCH] Reverse disordered-version warning message (#129904) The comment in `TransportHandshaker` indicates (correctly) that we emit a warning when talking to a chronologically-newer-yet-numerically-older version, but the wording of the warning message is inverted and says that the remote is chronologically-older-yet-numerically-newer. This commit straightens out the message to match the situation it is describing. Relates #123397 --- docs/changelog/129904.yaml | 5 +++++ .../elasticsearch/transport/TransportHandshaker.java | 4 ++-- .../transport/TransportHandshakerTests.java | 12 ++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 docs/changelog/129904.yaml diff --git a/docs/changelog/129904.yaml b/docs/changelog/129904.yaml new file mode 100644 index 0000000000000..f8945cac1d3c3 --- /dev/null +++ b/docs/changelog/129904.yaml @@ -0,0 +1,5 @@ +pr: 129904 +summary: Reverse disordered-version warning message +area: Infra/Core +type: bug +issues: [] diff --git a/server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java b/server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java index 17393a174aaac..4932390144c17 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java @@ -241,8 +241,8 @@ private static TransportVersion ensureCompatibleVersion( logger.warn( """ Negotiating transport handshake with remote node with version [{}/{}] received on [{}] which appears to be \ - from a chronologically-older release with a numerically-newer version compared to this node's version [{}/{}]. \ - Upgrading to a chronologically-older release may not work reliably and is not recommended. \ + from a chronologically-newer release with a numerically-older version compared to this node's version [{}/{}]. \ + Upgrading to this version from a chronologically-newer release may not work reliably and is not recommended. \ Falling back to transport protocol version [{}].""", releaseVersion, remoteTransportVersion, diff --git a/server/src/test/java/org/elasticsearch/transport/TransportHandshakerTests.java b/server/src/test/java/org/elasticsearch/transport/TransportHandshakerTests.java index c7270d077c2d9..8f5b8379a4b9b 100644 --- a/server/src/test/java/org/elasticsearch/transport/TransportHandshakerTests.java +++ b/server/src/test/java/org/elasticsearch/transport/TransportHandshakerTests.java @@ -134,9 +134,9 @@ public void testIncompatibleHandshakeRequest() throws Exception { Strings.format( """ Negotiating transport handshake with remote node with version [%s/%s] received on [*] which appears to be from \ - a chronologically-older release with a numerically-newer version compared to this node's version [%s/%s]. \ - Upgrading to a chronologically-older release may not work reliably and is not recommended. Falling back to \ - transport protocol version [%s].""", + a chronologically-newer release with a numerically-older version compared to this node's version [%s/%s]. \ + Upgrading to this version from a chronologically-newer release may not work reliably and is not recommended. \ + Falling back to transport protocol version [%s].""", handshakeRequest.releaseVersion, handshakeRequest.transportVersion, Build.current().version(), @@ -216,9 +216,9 @@ public void testHandshakeResponseFromOlderNodeWithPatchedProtocol() throws Excep Strings.format( """ Negotiating transport handshake with remote node with version [%s/%s] received on [*] which appears to be from \ - a chronologically-older release with a numerically-newer version compared to this node's version [%s/%s]. \ - Upgrading to a chronologically-older release may not work reliably and is not recommended. Falling back to \ - transport protocol version [%s].""", + a chronologically-newer release with a numerically-older version compared to this node's version [%s/%s]. \ + Upgrading to this version from a chronologically-newer release may not work reliably and is not recommended. \ + Falling back to transport protocol version [%s].""", handshakeResponse.getReleaseVersion(), handshakeResponse.getTransportVersion(), Build.current().version(),