-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Change deprecation.skip_deprecated_settings to work with dynamic settings #81836
Conversation
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.
I left a couple of comments, but I think this generally works
public static void setInitialEnvironmentSettings(Settings settings) { | ||
initialEnvironment = settings; |
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.
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)
List<String> skipTheseDeprecations = initialEnvironment == null | ||
? Collections.emptyList() | ||
: initialEnvironment.getAsList("deprecation.skip_deprecated_settings"); |
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.
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()); |
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.
I think a comment about what this line is for would be very helpful
@elasticsearchmachine update branch |
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.
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)
Closes #81700 |
Pinging @elastic/es-data-management (Team:Data Management) |
Relates #78725 |
…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.
…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.
…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.
…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.
…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.
…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.
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.