Skip to content
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

Change deprecation.skip_deprecated_settings to work with dynamic settings #81836

Conversation

masseyke
Copy link
Member

Previously, deprecation.skip_deprecated_settings did not work with dynamic settings. The reason is that when
the deprecation check was done, only the current settings were available. When the setting is a node setting that is
fine because deprecation.skip_deprecated_settings is also a node setting. However when the setting is dynamic,
deprecation.skip_deprecated_settings is not in the Settings object.

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

I left a couple of comments, but I think this generally works

Comment on lines 62 to 63
public static void setInitialEnvironmentSettings(Settings settings) {
initialEnvironment = settings;
Copy link
Member

Choose a reason for hiding this comment

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

Super minor, but we call these "nodeSettings" in a few places to distinguish them from generic Settings objects, might help clarify here (as well as adding javadoc)

Comment on lines 105 to 107
List<String> skipTheseDeprecations = initialEnvironment == null
? Collections.emptyList()
: initialEnvironment.getAsList("deprecation.skip_deprecated_settings");
Copy link
Member

Choose a reason for hiding this comment

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

Rather than re-create this list every time, and since we were planning on removing the dynamic property from deprecation.skip_deprecated_settings (since it's not really dynamic), can we just calculate the List<String> inside of setInitialEnvironmentSettings and then not have to calculate it for every log message?

@@ -325,6 +325,7 @@ protected Node(
final List<Closeable> resourcesToClose = new ArrayList<>(); // register everything we need to release in the case of an error
boolean success = false;
try {
DeprecationLogger.setInitialEnvironmentSettings(initialEnvironment.settings());
Copy link
Member

Choose a reason for hiding this comment

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

I think a comment about what this line is for would be very helpful

@masseyke
Copy link
Member Author

@elasticsearchmachine update branch

@masseyke masseyke requested a review from dakrone December 17, 2021 15:46
Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

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

LGTM. The rest compat changes are not intended to be run on 7x PRs and is being addressed elsewhere (so +1 to merge if the rest compat tests show as failing)

@masseyke masseyke marked this pull request as ready for review December 17, 2021 18:30
@masseyke masseyke merged commit 5059f31 into elastic:7.17 Dec 17, 2021
@masseyke masseyke deleted the fix/allow-hiding-deprecations-of-dynamic-settings branch December 17, 2021 18:30
@masseyke
Copy link
Member Author

Closes #81700

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Dec 17, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@masseyke
Copy link
Member Author

Relates #78725

@albertzaharovits albertzaharovits changed the title Getting deprecation.skip_deprecated_settings to work with dynamic settings Change deprecation.skip_deprecated_settings to work with dynamic settings Jan 25, 2022
masseyke added a commit to masseyke/elasticsearch that referenced this pull request Mar 1, 2022
…tings (elastic#81836)

Previously, deprecation.skip_deprecated_settings did not work with dynamic settings. The reason is that when
the deprecation check was done, only the current settings were available. When the setting is a node setting that is
fine because deprecation.skip_deprecated_settings is also a node setting. However when the setting is dynamic,
deprecation.skip_deprecated_settings is not in the Settings object.
elasticsearchmachine pushed a commit that referenced this pull request Mar 1, 2022
…tings (#81836) (#84523)

Previously, deprecation.skip_deprecated_settings did not work with dynamic settings. The reason is that when
the deprecation check was done, only the current settings were available. When the setting is a node setting that is
fine because deprecation.skip_deprecated_settings is also a node setting. However when the setting is dynamic,
deprecation.skip_deprecated_settings is not in the Settings object.
masseyke added a commit to masseyke/elasticsearch that referenced this pull request Mar 1, 2022
…tings (elastic#81836) (elastic#84523)

Previously, deprecation.skip_deprecated_settings did not work with dynamic settings. The reason is that when
the deprecation check was done, only the current settings were available. When the setting is a node setting that is
fine because deprecation.skip_deprecated_settings is also a node setting. However when the setting is dynamic,
deprecation.skip_deprecated_settings is not in the Settings object.
masseyke added a commit to masseyke/elasticsearch that referenced this pull request Mar 1, 2022
…tings (elastic#81836) (elastic#84523)

Previously, deprecation.skip_deprecated_settings did not work with dynamic settings. The reason is that when
the deprecation check was done, only the current settings were available. When the setting is a node setting that is
fine because deprecation.skip_deprecated_settings is also a node setting. However when the setting is dynamic,
deprecation.skip_deprecated_settings is not in the Settings object.
elasticsearchmachine pushed a commit that referenced this pull request Mar 1, 2022
…tings (#81836) (#84523) (#84527)

Previously, deprecation.skip_deprecated_settings did not work with dynamic settings. The reason is that when
the deprecation check was done, only the current settings were available. When the setting is a node setting that is
fine because deprecation.skip_deprecated_settings is also a node setting. However when the setting is dynamic,
deprecation.skip_deprecated_settings is not in the Settings object.
elasticsearchmachine pushed a commit that referenced this pull request Mar 1, 2022
…tings (#81836) (#84523) (#84526)

Previously, deprecation.skip_deprecated_settings did not work with dynamic settings. The reason is that when
the deprecation check was done, only the current settings were available. When the setting is a node setting that is
fine because deprecation.skip_deprecated_settings is also a node setting. However when the setting is dynamic,
deprecation.skip_deprecated_settings is not in the Settings object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Team:Data Management Meta label for data/management team v7.17.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants