- 
                Notifications
    
You must be signed in to change notification settings  - Fork 25.6k
 
Negotiate disordered transport handshakes #123397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negotiate disordered transport handshakes #123397
Conversation
Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications.
| 
           Pinging @elastic/es-core-infra (Team:Core/Infra)  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| return this; | ||
| } | ||
| TransportVersion bestSoFar = TransportVersions.ZERO; | ||
| for (final var knownVersion : VersionsHolder.ALL_VERSIONS_MAP.values()) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At one point we had the map as a NavigableMap, which would allow quickly finding the closest known version. Is the linear performance here "ok" because handshakes are only done on initial connection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep we hardly ever open new connections.
| final var bestKnownVersion = remoteTransportVersion.bestKnownVersion(); | ||
| if (bestKnownVersion.equals(TransportVersions.ZERO) == false) { | ||
| if (bestKnownVersion.equals(remoteTransportVersion) == false) { | ||
| // Remote is older than us, and we do not know its exact transport protocol version, so we choose a still-older version | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: older is ambiguous, this should be numerically-older right? Also, maybe use semantically-older since we generally talk about these as semantic versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ updated in 184ada9
          💔 Backport failed
 You can use sqren/backport to manually backport by running   | 
    
Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications. Backport of elastic#123397 to 9.0
Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications. Backport of elastic#123397 to 8.x
Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications. Backport of elastic#123397 to 8.18
Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications. Backport of elastic#123397 to 8.x
Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications. Backport of #123397 to 9.0
* Negotiate disordered transport handshakes Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications. Backport of #123397 to 8.x * Negotiate disordered transport handshakes Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications. Backport of #123397 to 8.x * Fix test * Fix for pre-8.9 versions
* Negotiate disordered transport handshakes Previously we'd reject transport handshakes from numerically-older nodes with a chronologically-newer release date. With this commit we instead negotiate to use the latest known version for future communications. Backport of #123397 to 8.18 * Fix test * Fix for pre-8.9 versions
In backporting elastic#123397 to 8.x we discovered that we needed to generalize `TransportVersion#bestKnownVersion` slightly to handle older versions. This commit forward-ports this change to keep the branches aligned.
In backporting #123397 to 8.x we discovered that we needed to generalize `TransportVersion#bestKnownVersion` slightly to handle older versions. This commit forward-ports this change to keep the branches aligned.
In backporting elastic#123397 to 8.x we discovered that we needed to generalize `TransportVersion#bestKnownVersion` slightly to handle older versions. This commit forward-ports this change to keep the branches aligned.
In backporting #123397 to 8.x we discovered that we needed to generalize `TransportVersion#bestKnownVersion` slightly to handle older versions. This commit forward-ports this change to keep the branches aligned.
In backporting elastic#123397 to 8.x we discovered that we needed to generalize `TransportVersion#bestKnownVersion` slightly to handle older versions. This commit forward-ports this change to keep the branches aligned.
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
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
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
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`
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
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 Backport of #129904 to `8.19`
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`
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 Backport of #129904 to `8.19`
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
Previously we'd reject transport handshakes from numerically-older nodes
with a chronologically-newer release date. With this commit we instead
negotiate to use the latest known version for future communications.