-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Always enforce default tier preference (ENFORCE_DEFAULT_TIER_PREFERENCE is ignored) #79751
Always enforce default tier preference (ENFORCE_DEFAULT_TIER_PREFERENCE is ignored) #79751
Conversation
By having MetadataCreateIndexService ignore the ENFORCE_DEFAULT_TIER_PREFERENCE setting (and, by extension, acting as if it's always true).
It's just always true, these tests need to learn to live with that.
The tests that checked what happens when we don't enforce a tier preference don't need to exist anymore. Likewise, since we always enforce we can rename the tests that check what happens when we do.
We'll be removing it one day, and it's only allowed to be true anyway, so there's no point in having it.
Rather, we can strip it from the settings and rely on the default
Pinging @elastic/es-data-management (Team:Data Management) |
Note: this is the alternative PR I mentioned in #79723 (comment) |
by setting the tier preference back to null after the index has been created
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.
|
||
public void testEnforceDefaultTierPreferenceSetting() { | ||
Settings settings = Settings.builder() | ||
.put(DataTier.ENFORCE_DEFAULT_TIER_PREFERENCE_SETTING.getKey(), true) |
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 that this could be randomBoolean()
in this version?
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.
Nice catch, ed12c39
Having the setting set at all is what's deprecated, it doesn't matter what the value actually is.
@elasticmachine run elasticsearch-ci/part-2 |
Part of #76147, follow up to #79210 and #79275
#79210 added this new setting, and #79275 made it so the value defaults to
true
. This PR goes one further, and makes it so that the setting is deprecated and ignored -- we force a tier preference, and there's no setting to disable that. Mostly it's adjusting the tests to account for that, there were some tests where we were still explicitly setting the value tofalse
in order to test 'what if' scenarios.