-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Add deprecation warning to TransportHandshaker #123188
Add deprecation warning to TransportHandshaker #123188
Conversation
Hi @JVerwolf, I've created a changelog YAML for you. Note that since this PR is labelled |
…thub.com:JVerwolf/elasticsearch into deprication/add-deprication-warning-to-handshake
To fix the |
Thanks @DaveCTurner. I'm unfamiliar with how the response headers are logged/reported on the sending node. I'm curious - since this work was motivated by CCR/CCS use-cases, would sending the headers back to the node that was the source of the request be useful here? Or, even if it is, would the headers still be adding complexity to the handshake to the point that this complexity outweigh the benefits? |
This PR doesn't directly relate to an actual CCR/CCS request, it's just about the transport handshake. It's true that the transport handshake might under some circumstances be triggered by a cross-cluster request, but often it's just going to be a background thing opening this connection. And most of the time a cross-cluster request will be using a connection that is already established so it won't get the warning anyway. If you want to see warnings on each CCR/CCS request, you probably need to implement them in the source cluster's |
…hake
…ion/add-deprication-warning-to-handshake
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Thanks for the info/context @DaveCTurner. That make sense, I've removed the warning header from the response. |
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.
Looks fine to me, but please let @DaveCTurner have a final look.
docs/changelog/123188.yaml
Outdated
deprecation: | ||
title: Add deprecation warning to `TransportHandshaker` | ||
area: REST API | ||
details: This PR adds a deprecation log to versions < v8.18. |
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: the details are more what you have in impact. The impact is that users should upgrade any clusters/nodes older than 8.18 in preparation for upgrading to 9.0.
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.
Yes I think this needs more detail. Whatever we write here gets converted into fairly prominent text in the release notes, we should spell out in detail what this change means to avoid causing any confusion to users.
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.
TIL, thanks! I've updated the notes, WDYT?
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.
Just a few nits. Also this needs to go into 8.x
as well as 8.18
.
docs/changelog/123188.yaml
Outdated
deprecation: | ||
title: Add deprecation warning to `TransportHandshaker` | ||
area: REST API | ||
details: This PR adds a deprecation log to versions < v8.18. |
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.
Yes I think this needs more detail. Whatever we write here gets converted into fairly prominent text in the release notes, we should spell out in detail what this change means to avoid causing any confusion to users.
|
||
MockLog.assertThatLogger( | ||
MockLog.awaitLogger( |
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.
Hmm why did this need to be changed from an immediate assertion?
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.
In a prior iteration it was failing when the deprecation log was hit first (I had thought this was because the loggers share the same name, as appears to be convention via other examples in the codebase). However, this is no longer happening - I set this up in a debugger to be sure. I'm not aware of what caused the behaviour difference, but I will revert this to assertThatLogger
now that this is no longer causing an issue.
} | ||
|
||
private static TransportVersion getRandomIncompatibleTransportVersion() { | ||
return randomBoolean() | ||
private static TransportVersion getRandomIncompatibleTransportVersion(boolean olderThanMinCompatible) { |
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.
Is this new parameter needed? It looks like we just pass in a randomBoolean()
and don't otherwise care?
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.
This is a leftover from a prior iteration, I'll remove it, thanks!
…thub.com:JVerwolf/elasticsearch into deprication/add-deprication-warning-to-handshake
…hake
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.
Editorial nits only :)
docs/changelog/123188.yaml
Outdated
Users will now see a deprecation log when a remote node, who's version is < v8.18, performs a transport handshake | ||
request with nodes >= v8.18 (e.g. during a CCS/CCR request). The remote cluster will need to be upgraded to >= v8.18 | ||
to maintain compatibility with clusters that have been upgraded to v9. |
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.
Maybe something like this?
Users will now see a deprecation log when a remote node, who's version is < v8.18, performs a transport handshake | |
request with nodes >= v8.18 (e.g. during a CCS/CCR request). The remote cluster will need to be upgraded to >= v8.18 | |
to maintain compatibility with clusters that have been upgraded to v9. | |
Versions 9.0.0 and later of {es} will not support communication with nodes of versions earlier than 8.18.0, | |
so the ability to connect to nodes of earlier versions is deprecated in this version. This applies both to | |
communication within a cluster and communication across clusters (e.g. for CCS or CCR). | |
{es} will report in its deprecation logs each time it opens a connection to a node that will not be supported | |
from version 9.0.0 onwards. You must upgrade all your clusters to version 8.18.0 or later before upgrading | |
any of your clusters to 9.0.0 or later. |
Bonus points for turning across clusters
, CCS
, CCR
and deprecation logs
into links to the relevant docs.
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.
Thank you!
Bonus points for turning across clusters, CCS, CCR and deprecation logs into links to the relevant docs.
Are you familiar with how to add a link here? (I skimmed the change logs and found no examples). Is this converted to markdown? Will the regular [link](url)
apply?
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.
This is Asciidoc so [xpack-ccr]
should link here for instance.
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.
Bah sorry wrong syntax, I meant <<xpack-ccr,{ccr}>>
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.
Much appreciated!
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: David Turner <david.turner@elastic.co>
…hake
@elasticmachine run elasticsearch-ci/part-2 |
…hake
💚 Backport successful
|
This PR adds a deprecation warning log to the TransportHandshaker when connecting with nodes < v8.18.
Jira: ES-10547
This PR adds a deprecation warning log to the TransportHandshaker when connecting with nodes < v8.18.