Skip to content

Add setting to enforce a default TIER_PREFERENCE#79210

Merged
joegallo merged 14 commits intoelastic:masterfrom
joegallo:enforce-default-tier-preference
Oct 15, 2021
Merged

Add setting to enforce a default TIER_PREFERENCE#79210
joegallo merged 14 commits intoelastic:masterfrom
joegallo:enforce-default-tier-preference

Conversation

@joegallo
Copy link
Copy Markdown
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 DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. v8.0.0 v7.16.0 labels Oct 15, 2021
@elasticmachine elasticmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Oct 15, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. >non-issue Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v7.16.0 v8.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants