Skip to content

Use ILM skip setting in shrink action #129455

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 3 commits into from
Jun 16, 2025

Conversation

nielsbauman
Copy link
Contributor

We add the skip setting to prevent ILM from processing the shrunken index before the execution state has been copied - which could happen if the shards of the shrunken index take a long time to allocate.

Resolves #109206

We add the skip setting to prevent ILM from processing the shrunken
index before the execution state has been copied - which could happen if
the shards of the shrunken index take a long time to allocate.

Resolves elastic#109206
@nielsbauman nielsbauman added >bug :Data Management/ILM+SLM Index and Snapshot lifecycle management auto-backport Automatically create backport pull requests when merged v8.19.0 labels Jun 15, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added Team:Data Management Meta label for data/management team v9.1.0 labels Jun 15, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@lukewhiting lukewhiting requested a review from Copilot June 16, 2025 09:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the ILM skip setting within the shrink action to avoid premature ILM processing prior to copying the execution state. It updates both test and production code in ShrinkStep and CopyExecutionStateStep, and documents the change in the changelog.

  • Adds the skip setting to the ILM shrink action in both the production code and tests.
  • Removes the skip setting from the index settings in CopyExecutionStateStep after copying the execution state.
  • Updates the changelog to reflect the behavioral change.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ShrinkStepTests.java Adds a test for the new ILM skip setting.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ShrinkStep.java Adds the ILM skip setting to the shrink action.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopyExecutionStateStep.java Removes the skip setting post execution state copy to allow proper ILM re-processing.
docs/changelog/129455.yaml Documents the resolution of #109206 with the ILM skip setting behavior.
Comments suppressed due to low confidence (1)

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopyExecutionStateStep.java:117

  • Consider calling newSettings.build() to convert the Settings.Builder to a Settings instance if indexMetadataBuilder.settings() expects an immutable Settings object.
indexMetadataBuilder.settings(newSettings);

Copy link
Contributor

@lukewhiting lukewhiting left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

@nielsbauman nielsbauman merged commit 217275c into elastic:main Jun 16, 2025
17 of 18 checks passed
@nielsbauman nielsbauman deleted the shrink-step-skip branch June 16, 2025 19:52
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts

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

nielsbauman added a commit to nielsbauman/elasticsearch that referenced this pull request Jun 17, 2025
We add the skip setting to prevent ILM from processing the shrunken
index before the execution state has been copied - which could happen if
the shards of the shrunken index take a long time to allocate.

Resolves elastic#109206

(cherry picked from commit 217275c)

# Conflicts:
#	x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopyExecutionStateStep.java
@nielsbauman
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Questions ?

Please refer to the Backport tool documentation

elasticsearchmachine pushed a commit that referenced this pull request Jun 17, 2025
* Use ILM skip setting in shrink action (#129455)

We add the skip setting to prevent ILM from processing the shrunken
index before the execution state has been copied - which could happen if
the shards of the shrunken index take a long time to allocate.

Resolves #109206

(cherry picked from commit 217275c)

# Conflicts:
#	x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CopyExecutionStateStep.java

* [CI] Auto commit changes from spotless

* Fix compilation

---------

Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
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 >bug :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ILM] Avoid race condition between shrinking and ILM itself
3 participants