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

Add setting to enforce a default TIER_PREFERENCE #79210

Merged
merged 14 commits into from
Oct 15, 2021

Conversation

joegallo
Copy link
Contributor

@joegallo joegallo commented Oct 15, 2021

Part of #76147

Adds a new cluster setting (cluster.routing.allocation.enforce_default_tier_preference), defaulting to false, that (if set to true) will inject a index.routing.allocation.include._tier_preference when indices are created. This is in addition to the other places where we have conditional logic that sometimes injects a default value, and it serves as a final backstop -- if nothing else sets the value, then this will. Minor caveat: it doesn't apply in the case of resizes (shrink/clone/split).

In a subsequent PR, this will be set to true on 8.0, but the tests work regardless of what the default is (those that require a particular value control it explicitly).

Still todo (but don't let that stop you from reviewing):
- [ ] Add docs for this new setting.

edit: I'm going to add the docs once this has settled better -- I've got four in flight PRs on this right now, and I don't want to do the the bigger aspects of the docs changes pitter patter across the lot of them.

/cc @dakrone FYI (and you're welcome to take a look!), but I'm explicitly asking for review from @henningandersen.

@joegallo joegallo added :Data Management/ILM+SLM Index and Snapshot lifecycle management v8.0.0 v7.16.0 labels Oct 15, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Oct 15, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

LGTM.

enforceDefaultTierPreference(true);

Template t = new Template(Settings.builder()
.putNull(DataTier.TIER_PREFERENCE)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we randomly pick between this and setting:

 .put(IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_PREFIX + ".box", "warm")

No problem if this is problematic, I do think we cover this somewhat with the unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm adding a reminder onto #76147 so that this isn't forgotten, but I want to unblock this PR and keep making progress for now.

My code here was mistaken -- there was a point where I didn't have the
new logic conditional on whether it was a resize/shrink/clone/split,
so I did need to change this test then, but indeed it's no longer
necessary.
The test reuses the same 'request' object from stanza to stanza, so we
have to carefully empty it out -- otherwise, if we're randomly using the
template settings here the request settings from the previous stanza
would leak through.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management >non-issue Team:Data Management Meta label for data/management team v7.16.0 v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants