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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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.

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 👍🏻

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