Skip to content

Conversation

@dakrone
Copy link
Member

@dakrone dakrone commented Jul 16, 2021

This commit enhances ILM's move-to-step API to allow dropping the name, or dropping both the
action and name. For example:

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:

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

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
@dakrone dakrone added >enhancement :Data Management/ILM+SLM Index and Snapshot lifecycle management v8.0.0 v7.15.0 labels Jul 16, 2021
@dakrone dakrone requested a review from andreidan July 16, 2021 23:18
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Jul 16, 2021
@elasticmachine
Copy link
Collaborator

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

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.

Much ❤️ for working on this @dakrone

return;
}

clusterService.submitStateUpdateTask("index[" + request.getIndex() + "]-move-to-step-" + targetStr,
Copy link
Contributor

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)

Copy link
Member Author

@dakrone dakrone Jul 19, 2021

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

@dakrone dakrone added auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Jul 19, 2021
@elasticsearchmachine elasticsearchmachine merged commit 3d5843a into elastic:master Jul 19, 2021
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

To backport manually run:
backport --pr 75435

dakrone added a commit to dakrone/elasticsearch that referenced this pull request Jul 19, 2021
* 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
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Jul 19, 2021
This disables the tests so that the move to step changes in elastic#75435 can be backported

Relates to elastic#75480
dakrone added a commit that referenced this pull request Jul 19, 2021
)

* 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
dakrone added a commit that referenced this pull request Jul 19, 2021
This disables the tests so that the move to step changes in #75435 can be backported

Relates to #75480
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Jul 19, 2021
This also adjusts the version constants now that elastic#75480 has been merged.

Relates to elastic#75480 and elastic#75435
elasticsearchmachine pushed a commit that referenced this pull request Jul 19, 2021
This also adjusts the version constants now that #75480 has been merged.

Relates to #75480 and #75435
ywangd pushed a commit to ywangd/elasticsearch that referenced this pull request Jul 30, 2021
* 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]>
ywangd pushed a commit to ywangd/elasticsearch that referenced this pull request Jul 30, 2021
This disables the tests so that the move to step changes in elastic#75435 can be backported

Relates to elastic#75480
ywangd pushed a commit to ywangd/elasticsearch that referenced this pull request Jul 30, 2021
This also adjusts the version constants now that elastic#75480 has been merged.

Relates to elastic#75480 and elastic#75435
stefnestor added a commit that referenced this pull request Sep 24, 2022
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`.
abdonpijpelink added a commit that referenced this pull request Jan 23, 2023
* [+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]>
stefnestor added a commit to stefnestor/elasticsearch that referenced this pull request Jan 23, 2023
* [+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]>
abdonpijpelink added a commit that referenced this pull request Jan 23, 2023
* [+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]>
abdonpijpelink added a commit to abdonpijpelink/elasticsearch that referenced this pull request Jan 23, 2023
* [+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]>
elasticsearchmachine pushed a commit that referenced this pull request Jan 23, 2023
* [+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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement Team:Data Management Meta label for data/management team v7.15.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance move-to-step API to allow optionally dropping step name

5 participants