-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Allow ILM move-to-step without action or name
#75435
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
Allow ILM move-to-step without action or name
#75435
Conversation
This commit enhances ILM's move-to-step API to allow dropping the `name`, or dropping both the
`action` and `name`. For example:
```json
POST /_ilm/move/foo-1
{
"current_step": {
"phase": "hot",
"action": "rollover",
"name": "check-rollover-ready"
},
"next_step": {
"phase": "warm",
"action": "forcemerge"
}
}
```
Will move to the first step in the `forcemerge` action in the `warm` phase (without having to know
the specific step name).
Another example:
```json
POST /_ilm/move/foo-1
{
"current_step": {
"phase": "hot",
"action": "rollover",
"name": "check-rollover-ready"
},
"next_step": {
"phase": "warm"
}
}
```
Will move to the first step in the `warm` phase (without having to know the specific action name).
Bear in mind that the execution order is still entirely an implementation detail, so "first" in the
above sentences means the first step that ILM would execute.
Resolves elastic#58128
|
Pinging @elastic/es-core-features (Team:Core/Features) |
andreidan
left a comment
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.
Much ❤️ for working on this @dakrone
| return; | ||
| } | ||
|
|
||
| clusterService.submitStateUpdateTask("index[" + request.getIndex() + "]-move-to-step-" + targetStr, |
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.
should this use concreteTargetStepKey instead of the (potentially) partial targetStr ? (to avoid a human having to parse what the actual target is when inspecting the tasks)
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.
One issue is that we don't know the real concrete target step key until we're in the cluster state update (because there could be changes to the policy between now and when the cluster state update is executed), so I left this as something like hot/null/null so that we can see in logs that the user meant to move to the first action in the hot phase (regardless of what it is), we still have logging for the actual concrete step that it was moved to
...k/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/TransportMoveToStepAction.java
Outdated
Show resolved
Hide resolved
💔 Backport failed
To backport manually run: |
* Allow ILM move-to-step without `action` or `name`
This commit enhances ILM's move-to-step API to allow dropping the `name`, or dropping both the
`action` and `name`. For example:
```json
POST /_ilm/move/foo-1
{
"current_step": {
"phase": "hot",
"action": "rollover",
"name": "check-rollover-ready"
},
"next_step": {
"phase": "warm",
"action": "forcemerge"
}
}
```
Will move to the first step in the `forcemerge` action in the `warm` phase (without having to know
the specific step name).
Another example:
```json
POST /_ilm/move/foo-1
{
"current_step": {
"phase": "hot",
"action": "rollover",
"name": "check-rollover-ready"
},
"next_step": {
"phase": "warm"
}
}
```
Will move to the first step in the `warm` phase (without having to know the specific action name).
Bear in mind that the execution order is still entirely an implementation detail, so "first" in the
above sentences means the first step that ILM would execute.
Resolves elastic#58128
* Apply Andrei's wording change (thanks!)
Co-authored-by: Andrei Dan <[email protected]>
* Log index and policy name when the concrete step key can't be resolved
Co-authored-by: Andrei Dan <[email protected]>
# Conflicts:
# x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java
This disables the tests so that the move to step changes in elastic#75435 can be backported Relates to elastic#75480
) * Allow ILM move-to-step without `action` or `name` This commit enhances ILM's move-to-step API to allow dropping the `name`, or dropping both the `action` and `name`. For example: ```json POST /_ilm/move/foo-1 { "current_step": { "phase": "hot", "action": "rollover", "name": "check-rollover-ready" }, "next_step": { "phase": "warm", "action": "forcemerge" } } ``` Will move to the first step in the `forcemerge` action in the `warm` phase (without having to know the specific step name). Another example: ```json POST /_ilm/move/foo-1 { "current_step": { "phase": "hot", "action": "rollover", "name": "check-rollover-ready" }, "next_step": { "phase": "warm" } } ``` Will move to the first step in the `warm` phase (without having to know the specific action name). Bear in mind that the execution order is still entirely an implementation detail, so "first" in the above sentences means the first step that ILM would execute. Resolves #58128 * Apply Andrei's wording change (thanks!) Co-authored-by: Andrei Dan <[email protected]> * Log index and policy name when the concrete step key can't be resolved Co-authored-by: Andrei Dan <[email protected]> # Conflicts: # x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java
This also adjusts the version constants now that elastic#75480 has been merged. Relates to elastic#75480 and elastic#75435
* Allow ILM move-to-step without `action` or `name`
This commit enhances ILM's move-to-step API to allow dropping the `name`, or dropping both the
`action` and `name`. For example:
```json
POST /_ilm/move/foo-1
{
"current_step": {
"phase": "hot",
"action": "rollover",
"name": "check-rollover-ready"
},
"next_step": {
"phase": "warm",
"action": "forcemerge"
}
}
```
Will move to the first step in the `forcemerge` action in the `warm` phase (without having to know
the specific step name).
Another example:
```json
POST /_ilm/move/foo-1
{
"current_step": {
"phase": "hot",
"action": "rollover",
"name": "check-rollover-ready"
},
"next_step": {
"phase": "warm"
}
}
```
Will move to the first step in the `warm` phase (without having to know the specific action name).
Bear in mind that the execution order is still entirely an implementation detail, so "first" in the
above sentences means the first step that ILM would execute.
Resolves elastic#58128
* Apply Andrei's wording change (thanks!)
Co-authored-by: Andrei Dan <[email protected]>
* Log index and policy name when the concrete step key can't be resolved
Co-authored-by: Andrei Dan <[email protected]>
This disables the tests so that the move to step changes in elastic#75435 can be backported Relates to elastic#75480
This also adjusts the version constants now that elastic#75480 has been merged. Relates to elastic#75480 and elastic#75435
Updates [doc](https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-move-to-step.html?edit) to append example similar to #75435 (≥v7.15.0) to show users working example of only using `next_step.phase`.
* [+DOC] ILM Move Step example only phase Updates [doc](https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-move-to-step.html?edit) to append example similar to #75435 (≥v7.15.0) to show users working example of only using `next_step.phase`. * Move example to the end of the page * Fix failing code snippet tests Co-authored-by: Abdon Pijpelink <[email protected]>
* [+DOC] ILM Move Step example only phase Updates [doc](https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-move-to-step.html?edit) to append example similar to elastic#75435 (≥v7.15.0) to show users working example of only using `next_step.phase`. * Move example to the end of the page * Fix failing code snippet tests Co-authored-by: Abdon Pijpelink <[email protected]>
* [+DOC] ILM Move Step example only phase Updates [doc](https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-move-to-step.html?edit) to append example similar to #75435 (≥v7.15.0) to show users working example of only using `next_step.phase`. * Move example to the end of the page * Fix failing code snippet tests * Skip test Co-authored-by: Stef Nestor <[email protected]>
* [+DOC] ILM Move Step example only phase Updates [doc](https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-move-to-step.html?edit) to append example similar to elastic#75435 (≥v7.15.0) to show users working example of only using `next_step.phase`. * Move example to the end of the page * Fix failing code snippet tests * Skip test Co-authored-by: Stef Nestor <[email protected]>
* [+DOC] ILM Move Step example only phase Updates [doc](https://www.elastic.co/guide/en/elasticsearch/reference/master/ilm-move-to-step.html?edit) to append example similar to #75435 (≥v7.15.0) to show users working example of only using `next_step.phase`. * Move example to the end of the page * Fix failing code snippet tests * Skip test Co-authored-by: Stef Nestor <[email protected]> Co-authored-by: Stef Nestor <[email protected]>
This commit enhances ILM's move-to-step API to allow dropping the
name, or dropping both theactionandname. For example:Will move to the first step in the
forcemergeaction in thewarmphase (without having to knowthe specific step name).
Another example:
Will move to the first step in the
warmphase (without having to know the specific action name).Bear in mind that the execution order is still entirely an implementation detail, so "first" in the
above sentences means the first step that ILM would execute.
Resolves #58128