Skip to content

DesiredNode: deprecate node_version field and make it optional (unused) in current parser#104209

Merged
ldematte merged 22 commits intoelastic:mainfrom
ldematte:desired-node-version-deprecation
Jan 29, 2024
Merged

DesiredNode: deprecate node_version field and make it optional (unused) in current parser#104209
ldematte merged 22 commits intoelastic:mainfrom
ldematte:desired-node-version-deprecation

Conversation

@ldematte
Copy link
Copy Markdown
Contributor

@ldematte ldematte commented Jan 10, 2024

This PR follow our conversation on usage of semantic versions in APIs (new or old).
We agreed that the "no-downgrade" check currently done inside DesiredNode (DesiredNodesSettingsValidator) is better done externally (e.g. by ECK tools/services). Moving forward, we will need a more refined (and different) way to ensure the new topology is acceptable based on features, not on a catch-all version - the same API in serverless is bound to be quite different.

The DesiredNode parser still retains node_version to ensure compatibility, but it is now optional (and the parsed valued is discarded) and a deprecation warning is added to the response when this is specified.

@ldematte ldematte added >deprecation :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. v8.13.0 and removed v8.13.0 labels Jan 10, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @ldematte, I've created a changelog YAML for you. Note that since this PR is labelled >deprecation, you need to update the changelog YAML to fill out the extended information sections.

@ldematte ldematte added the :Core/Infra/Core Core issues without another label label Jan 10, 2024
@ldematte ldematte requested a review from fcofdez January 16, 2024 09:13
@ldematte ldematte marked this pull request as ready for review January 16, 2024 09:13
@elasticsearchmachine elasticsearchmachine added Team:Core/Infra Meta label for core/infra team Team:Distributed Meta label for distributed team. labels Jan 16, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

storage.writeTo(out);
Version.writeVersion(version, out);
if (out.getTransportVersion().onOrAfter(TransportVersions.DESIRED_NODE_VERSION_OPTIONAL_STRING)) {
out.writeOptionalString(version);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need to maintain the string in the serialization at all?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since we are just deprecating the change, I thought it was better to keep the requested value in the response - so if you have a request with version inside (deprecated, but still valid), you find it in the responses too.
This is the most conservative route I think; I'm open to remove it altogether if we agree this is OK.

Copy link
Copy Markdown
Contributor

@fcofdez fcofdez left a comment

Choose a reason for hiding this comment

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

Looks good 👍. I just left a question about the version validation


private static Version parseLegacyVersion(String version) {
if (version != null) {
var semanticVersionMatcher = SEMANTIC_VERSION_PATTERN.matcher(version);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need this check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since the API now accepts anything as node_version, there is change this is an empty string or anything really. An alternative is to have this check during parsing (line 108), so we keep rejecting invalid/non-semantic versions (you either skip it or provide a valid one).
We don't really need it, we just need a Version if we are talking to older nodes (TransportVersion < DESIRED_NODE_VERSION_OPTIONAL_STRING), that's why the check is here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But let me know if you prefer to move it in the parser @fcofdez

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's easier to understand if we keep the validation in the parser, but it's not a strong preference 👍

@ldematte ldematte added the test-full-bwc Trigger full BWC version matrix tests label Jan 29, 2024
@ldematte ldematte merged commit 0e328db into elastic:main Jan 29, 2024
@ldematte ldematte deleted the desired-node-version-deprecation branch January 29, 2024 13:09
arteam added a commit to arteam/elasticsearch that referenced this pull request Oct 11, 2024
It was deprecated in elastic#104209 (8.13) and shouldn't be set in 9.0
arteam added a commit that referenced this pull request Oct 24, 2024
It was deprecated in #104209 (8.13) and shouldn't be set or returned in 9.0

The Desired Nodes API is an internal API, and users shouldn't depend on its backward compatibility.
georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Oct 25, 2024
…ic#114580)

It was deprecated in elastic#104209 (8.13) and shouldn't be set or returned in 9.0

The Desired Nodes API is an internal API, and users shouldn't depend on its backward compatibility.
jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Nov 4, 2024
…ic#114580)

It was deprecated in elastic#104209 (8.13) and shouldn't be set or returned in 9.0

The Desired Nodes API is an internal API, and users shouldn't depend on its backward compatibility.
arteam added a commit to arteam/elasticsearch that referenced this pull request Dec 19, 2024
…ic#114580)

> It was deprecated in elastic#104209 (8.13) and shouldn't be set or returned in 9.0

Note: This PR is still pending on the 9.0 transport version
arteam added a commit that referenced this pull request Feb 5, 2025
Re-submission of #114580

>  node_version was deprecated in #104209 (8.13) and shouldn't be set or returned in 9.0

Resolve ES-9443
arteam added a commit to arteam/elasticsearch that referenced this pull request Feb 5, 2025
…lastic#119049)

Backports elastic#119049 to 9.0

>  Re-submission of elastic#114580
>  node_version was deprecated in elastic#104209 (8.13) and shouldn't be set or returned in 9.0
elasticsearchmachine pushed a commit that referenced this pull request Feb 5, 2025
…119049) (#121775)

Backports #119049 to 9.0

>  Re-submission of #114580
>  node_version was deprecated in #104209 (8.13) and shouldn't be set or returned in 9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >deprecation :Distributed/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. Team:Core/Infra Meta label for core/infra team Team:Distributed Meta label for distributed team. test-full-bwc Trigger full BWC version matrix tests v8.13.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants