Skip to content

Add support for a custom transport version check predicate in ElasticsearchException #126272

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

Merged

Conversation

ldematte
Copy link
Contributor

@ldematte ldematte commented Apr 4, 2025

Today when we are adding a ElasticsearchException, we specify a versionAdded TransportVersion (the transport version from which we support it); this version is checked by the isRegistered method:

return version.onOrAfter(elasticsearchExceptionHandle.versionAdded);

This does not play well with backports; when we add a patch version for a backport, normally the procedure would be to change the code above take also the patch into account, like:

version.orOnAfter(versionAdded) || version.isPatchFrom(versionPatched)

This PR updates ElasticsearchException to have more than just "version added", so that we can do patches as described above.

@ldematte ldematte added :Core/Infra/Core Core issues without another label >refactoring auto-backport Automatically create backport pull requests when merged v9.0.1 v9.1.0 labels Apr 4, 2025
@ldematte ldematte marked this pull request as ready for review April 4, 2025 10:26
@ldematte ldematte requested a review from a team April 4, 2025 10:26
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Apr 4, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@mosche mosche left a comment

Choose a reason for hiding this comment

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

LGTM

@ldematte ldematte merged commit b692d1a into elastic:main Apr 9, 2025
17 checks passed
@ldematte ldematte deleted the elasticsearch-exception-custom-version-check branch April 9, 2025 09:44
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
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 126272

@ldematte ldematte removed the v9.0.1 label Apr 9, 2025
ldematte added a commit to ldematte/elasticsearch that referenced this pull request Apr 9, 2025
…searchException (elastic#126272)

Today when we are adding a ElasticsearchException, we specify a versionAdded TransportVersion (the transport version from which we support it); this version is checked by the isRegistered method:

return version.onOrAfter(elasticsearchExceptionHandle.versionAdded);

This does not play well with backports; when we add a patch version for a backport, normally the procedure would be to change the code above take also the patch into account, like:

version.orOnAfter(versionAdded) || version.isPatchFrom(versionPatched)

This PR updates ElasticsearchException to have more than just "version added", so that we can do patches as described above.
elasticsearchmachine pushed a commit that referenced this pull request Apr 9, 2025
…searchException (#126272) (#126520)

Today when we are adding a ElasticsearchException, we specify a versionAdded TransportVersion (the transport version from which we support it); this version is checked by the isRegistered method:

return version.onOrAfter(elasticsearchExceptionHandle.versionAdded);

This does not play well with backports; when we add a patch version for a backport, normally the procedure would be to change the code above take also the patch into account, like:

version.orOnAfter(versionAdded) || version.isPatchFrom(versionPatched)

This PR updates ElasticsearchException to have more than just "version added", so that we can do patches as described above.
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 :Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants