Skip to content

Add index.routing.allocation.include._tier_preference setting #62589

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

Merged
merged 7 commits into from
Sep 18, 2020

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Sep 17, 2020

This commit adds the index.routing.allocation.include._tier_preference setting to the
DataTierAllocationDecider. This special-purpose allocation setting lets a user specify a
preference-based list of tiers for an index to be assigned to. For example, if the setting were set
to:

"index.routing.allocation.include._tier_preference": "data_hot,data_warm,data_content"

If the cluster contains any nodes with the data_hot role, the decider will only allow them to be
allocated on the data_hot node(s). If there are no data_hot nodes, but there are data_warm and
data_content nodes, then the index will be allowed to be allocated on data_warm nodes.

This allows us to specify an index's preference for tier(s) without causing the index to be
unassigned if no nodes of a preferred tier are available.

Subsequent work will change the ILM migration to make additional use of this setting.

Relates to #60848

This commit adds the `index.routing.allocation.prefer._tier` setting to the
`DataTierAllocationDecider`. This special-purpose allocation setting lets a user specify a
preference-based list of tiers for an index to be assigned to. For example, if the setting were set
to:

```
"index.routing.allocation.prefer._tier": "data_hot,data_warm,data_content"
```

If the cluster contains any nodes with the `data_hot` role, the decider will only allow them to be
allocated on the `data_hot` node(s). If there are no `data_hot` nodes, but there are `data_warm` and
`data_content` nodes, then the index will be allowed to be allocated on `data_warm` nodes.

This allows us to specify an index's preference for tier(s) without causing the index to be
unassigned if no nodes of a preferred tier are available.

Subsequent work will change the ILM migration to make additional use of this setting.

Relates to elastic#60848
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Features)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Sep 17, 2020
@dakrone
Copy link
Member Author

dakrone commented Sep 17, 2020

Since this setting is not part of the existing preference group, we need to handle backwards compatibility. I think we have a couple of options here:

  • Find a way to determine the node versions when the index is created, ignoring the setting for versions that don't support it.
  • Collapsed the setting into one of the existing groups, so something like: index.routing.allocation.include._tier_preference or index.routing.allocation.include._prefer_tier

Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

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

Thanks for working on this Lee.

I've left a couple of rather minor suggestions.

Can you please add some tests to show illustrate the include/exclude/require precedence over preferred?

@dakrone
Copy link
Member Author

dakrone commented Sep 18, 2020

Thanks Andrei, I made the changes you suggested

@dakrone dakrone requested a review from andreidan September 18, 2020 16:39
@dakrone
Copy link
Member Author

dakrone commented Sep 18, 2020

@elasticmachine run elasticsearch-ci/packaging-sample-windows

@dakrone
Copy link
Member Author

dakrone commented Sep 18, 2020

@elasticmachine update branch

elasticmachine and others added 3 commits September 18, 2020 13:01
DiscoveryNodeFilters needs to ignore all _tier* attributes, not just _tier
@dakrone
Copy link
Member Author

dakrone commented Sep 18, 2020

@elasticmachine test this please

@dakrone
Copy link
Member Author

dakrone commented Sep 18, 2020

@elasticmachine run elasticsearch-ci/2

Copy link
Contributor

@andreidan andreidan 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 Lee

@dakrone dakrone merged commit 0c35995 into elastic:master Sep 18, 2020
@dakrone dakrone deleted the dt-allow-preference-for-tier branch September 18, 2020 20:50
@dakrone dakrone changed the title Add index.routing.allocation.prefer._tier setting Add index.routing.allocation.include._tier_preference setting Sep 18, 2020
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Sep 18, 2020
This commit adds the `index.routing.allocation.prefer._tier` setting to the
`DataTierAllocationDecider`. This special-purpose allocation setting lets a user specify a
preference-based list of tiers for an index to be assigned to. For example, if the setting were set
to:

```
"index.routing.allocation.prefer._tier": "data_hot,data_warm,data_content"
```

If the cluster contains any nodes with the `data_hot` role, the decider will only allow them to be
allocated on the `data_hot` node(s). If there are no `data_hot` nodes, but there are `data_warm` and
`data_content` nodes, then the index will be allowed to be allocated on `data_warm` nodes.

This allows us to specify an index's preference for tier(s) without causing the index to be
unassigned if no nodes of a preferred tier are available.

Subsequent work will change the ILM migration to make additional use of this setting.

Relates to elastic#60848
dakrone added a commit that referenced this pull request Sep 18, 2020
…62589) (#62667)

This commit adds the `index.routing.allocation.prefer._tier` setting to the
`DataTierAllocationDecider`. This special-purpose allocation setting lets a user specify a
preference-based list of tiers for an index to be assigned to. For example, if the setting were set
to:

```
"index.routing.allocation.prefer._tier": "data_hot,data_warm,data_content"
```

If the cluster contains any nodes with the `data_hot` role, the decider will only allow them to be
allocated on the `data_hot` node(s). If there are no `data_hot` nodes, but there are `data_warm` and
`data_content` nodes, then the index will be allowed to be allocated on `data_warm` nodes.

This allows us to specify an index's preference for tier(s) without causing the index to be
unassigned if no nodes of a preferred tier are available.

Subsequent work will change the ILM migration to make additional use of this setting.

Relates to #60848
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Data Management Meta label for data/management team v7.10.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants