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

Adding a deprecation info API check for fractional byte value settings #77074

Merged

Conversation

masseyke
Copy link
Member

In 6.2.0 we deprecated support for fractional byte value settings. Support was originally going to be
removed altogether in 8.0.0 (see #53927) but that PR was not merged. This commit adds a warning
deprecation info check if any fractional byte values settings are found.
Relates #42404

@masseyke masseyke requested a review from jbaiera August 31, 2021 15:06
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Aug 31, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

LGTM

Left some comments, but not sure if any of them are particularly actionable. I wish there were a good/easy way to specifically target the settings that expect byte values, but this should do well enough.

Map<String, String> fractionalByteSettings = new HashMap<>();
for (String key : settings.keySet()) {
try {
settings.getAsBytesSize(key, ByteSizeValue.ZERO);
Copy link
Member

Choose a reason for hiding this comment

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

This looks like it triggers deprecation logging as well for each fractional value read, do we want that?

if (stringValue.contains(".")) {
fractionalByteSettings.put(key, stringValue);
}
} catch (Exception ignoreThis) {
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I'm not a huge fan of Exception based control flow. I know that settings are registered with ClusterSettings and IndexScopedSettings so that settings can be validated against the master set, but I don't know if we can filter on the setting's data type due to type erasure, and I'm not sure if those are comprehensive for every setting either.

@masseyke
Copy link
Member Author

masseyke commented Sep 7, 2021

@elasticmachine update branch

@masseyke masseyke merged commit 4968d01 into elastic:7.x Sep 7, 2021
@masseyke masseyke deleted the feature/deprecation-info-fractional-byte-sizes branch September 7, 2021 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue Team:Data Management Meta label for data/management team v7.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants