Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

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.

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.
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Feb 25, 2025
Copy link
Member

@rjernst rjernst left a 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()) {
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ updated in 184ada9

@DaveCTurner DaveCTurner added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport Automatically create backport pull requests when merged labels Feb 27, 2025
@elasticsearchmachine elasticsearchmachine merged commit 6bdb9fe into elastic:main Feb 28, 2025
17 checks passed
@DaveCTurner DaveCTurner deleted the 2025/02/25/transport-handshake-patch branch February 28, 2025 20:14
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.18 Commit could not be cherrypicked due to conflicts
8.x Commit could not be cherrypicked due to conflicts
9.0 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 123397

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Feb 28, 2025
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
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Feb 28, 2025
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
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Feb 28, 2025
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
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Mar 1, 2025
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
elasticsearchmachine pushed a commit that referenced this pull request Mar 1, 2025
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
elasticsearchmachine pushed a commit that referenced this pull request Mar 1, 2025
* 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
elasticsearchmachine pushed a commit that referenced this pull request Mar 1, 2025
* 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
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Mar 1, 2025
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.
DaveCTurner added a commit that referenced this pull request Mar 4, 2025
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.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Mar 4, 2025
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.
elasticsearchmachine pushed a commit that referenced this pull request Mar 4, 2025
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.
georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Mar 11, 2025
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.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jun 24, 2025
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
DaveCTurner added a commit that referenced this pull request Jun 24, 2025
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
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jun 24, 2025
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
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jun 24, 2025
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`
elasticsearchmachine pushed a commit that referenced this pull request Jun 24, 2025
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
elasticsearchmachine pushed a commit that referenced this pull request Jun 24, 2025
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`
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jun 24, 2025
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`
elasticsearchmachine pushed a commit that referenced this pull request Jun 24, 2025
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`
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 25, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Core/Infra/Transport API Transport client API >non-issue Team:Core/Infra Meta label for core/infra team v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants