Skip to content

Commit 82800f9

Browse files
authored
Reverse disordered-version warning message (elastic#129956)
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 elastic#123397 Backport of elastic#129904 to `8.19`
1 parent 975889d commit 82800f9

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

docs/changelog/129904.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 129904
2+
summary: Reverse disordered-version warning message
3+
area: Infra/Core
4+
type: bug
5+
issues: []

server/src/main/java/org/elasticsearch/transport/TransportHandshaker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ private static TransportVersion ensureCompatibleVersion(
301301
logger.warn(
302302
"""
303303
Negotiating transport handshake with remote node with version [{}/{}] received on [{}] which appears to be \
304-
from a chronologically-older release with a numerically-newer version compared to this node's version [{}/{}]. \
305-
Upgrading to a chronologically-older release may not work reliably and is not recommended. \
304+
from a chronologically-newer release with a numerically-older version compared to this node's version [{}/{}]. \
305+
Upgrading to this version from a chronologically-newer release may not work reliably and is not recommended. \
306306
Falling back to transport protocol version [{}].""",
307307
remoteReleaseVersion,
308308
remoteTransportVersion,

server/src/test/java/org/elasticsearch/transport/TransportHandshakerTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ public void testIncompatibleHandshakeRequest() throws Exception {
132132
Strings.format(
133133
"""
134134
Negotiating transport handshake with remote node with version [%s/%s] received on [*] which appears to be from \
135-
a chronologically-older release with a numerically-newer version compared to this node's version [%s/%s]. \
136-
Upgrading to a chronologically-older release may not work reliably and is not recommended. Falling back to \
137-
transport protocol version [%s].""",
135+
a chronologically-newer release with a numerically-older version compared to this node's version [%s/%s]. \
136+
Upgrading to this version from a chronologically-newer release may not work reliably and is not recommended. \
137+
Falling back to transport protocol version [%s].""",
138138
handshakeRequest.transportVersion.toReleaseVersion(),
139139
handshakeRequest.transportVersion,
140140
Build.current().version(),
@@ -220,9 +220,9 @@ public void testHandshakeResponseFromOlderNodeWithPatchedProtocol() throws Excep
220220
Strings.format(
221221
"""
222222
Negotiating transport handshake with remote node with version [%s/%s] received on [*] which appears to be from \
223-
a chronologically-older release with a numerically-newer version compared to this node's version [%s/%s]. \
224-
Upgrading to a chronologically-older release may not work reliably and is not recommended. Falling back to \
225-
transport protocol version [%s].""",
223+
a chronologically-newer release with a numerically-older version compared to this node's version [%s/%s]. \
224+
Upgrading to this version from a chronologically-newer release may not work reliably and is not recommended. \
225+
Falling back to transport protocol version [%s].""",
226226
handshakeResponse.getReleaseVersion(),
227227
handshakeResponse.getTransportVersion(),
228228
Build.current().version(),

0 commit comments

Comments
 (0)