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

Migrate to data tiers routing configures correct default for mounted indices #97936

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

andreidan
Copy link
Contributor

This fixes the default tier preference configuration the
migrate to tier routing API sets for fully and partially mounted
indices when the index was not migrated using the requested
attribute name and it doesn't have any _tier_preference
setting configured.

Fixes #97898

@andreidan andreidan requested a review from dakrone July 25, 2023 14:48
Comment on lines -145 to -160
/**
* Returns true iff the given settings have a data tier setting configured
*/
public static boolean isExplicitDataTier(Settings settings) {
/*
* This method can be called before the o.e.n.NodeRoleSettings.NODE_ROLES_SETTING is
* initialized. We do not want to trigger initialization prematurely because that will bake
* the default roles before plugins have had a chance to register them. Therefore,
* to avoid initializing this setting prematurely, we avoid using the actual node roles
* setting instance here in favor of the string.
*/
if (settings.hasValue("node.roles")) {
return settings.getAsList("node.roles").stream().anyMatch(DataTier::validTierName);
}
return false;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an unused method

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Jul 25, 2023
@elasticsearchmachine
Copy link
Collaborator

Hi @andreidan, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this Andrei

@andreidan andreidan added auto-backport-and-merge auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Jul 26, 2023
@andreidan andreidan merged commit 1f24b9d into elastic:main Jul 26, 2023
@andreidan andreidan deleted the migrate-to-default-tier branch July 26, 2023 04:19
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.9 Commit could not be cherrypicked due to conflicts
7.17 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 97936

andreidan added a commit to andreidan/elasticsearch that referenced this pull request Jul 26, 2023
…indices (elastic#97936)

(cherry picked from commit 1f24b9d)
Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
elasticsearchmachine pushed a commit that referenced this pull request Jul 26, 2023
…indices (#97936) (#97951)

(cherry picked from commit 1f24b9d)
Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >bug :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team v7.17.13 v8.9.1 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to data tiers API can configure data_content/data_hot for partially mounted indices
3 participants