Skip to content

Conversation

@parkertimmins
Copy link
Contributor

When a lifecycle name is added to an index, ILM will immediately attempt to process it. When reindexing indices, if the destination index has a lifecycle name before it added to the data stream, this will cause ILM to fail. We should filter out the lifecycle name from the setting copied from the source index to the destination index, and only add it back to the destination index after it has been added to the data stream.

@parkertimmins parkertimmins added >non-issue :Data Management/Data streams Data streams and their lifecycles auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 v9.1.0 labels Feb 20, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Feb 20, 2025
@masseyke masseyke self-requested a review February 20, 2025 20:26
Copy link
Member

@masseyke masseyke left a comment

Choose a reason for hiding this comment

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

Other than my comment about adding a couple of comments (we won't remember this at all a year from now), LGTM.

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

@parkertimmins parkertimmins merged commit f044d97 into elastic:main Feb 21, 2025
17 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.0
8.18 Commit could not be cherrypicked due to conflicts
8.x Commit could not be cherrypicked due to conflicts

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

parkertimmins added a commit to parkertimmins/elasticsearch that referenced this pull request Feb 21, 2025
elastic#123071)

When reindexing a data stream, remove the lifecycle name setting when creating the destination index, so that ILM does not process it. Add the setting back after adding the destination index to the data stream, at which point ILM can safely process it.
parkertimmins added a commit to parkertimmins/elasticsearch that referenced this pull request Feb 21, 2025
elastic#123071)

When reindexing a data stream, remove the lifecycle name setting when creating the destination index, so that ILM does not process it. Add the setting back after adding the destination index to the data stream, at which point ILM can safely process it.

(cherry picked from commit f044d97)

# Conflicts:
#	x-pack/plugin/migrate/src/internalClusterTest/java/org/elasticsearch/xpack/migrate/action/ReindexDatastreamIndexTransportActionIT.java
@parkertimmins
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x
8.18

Questions ?

Please refer to the Backport tool documentation

parkertimmins added a commit to parkertimmins/elasticsearch that referenced this pull request Feb 21, 2025
elastic#123071)

When reindexing a data stream, remove the lifecycle name setting when creating the destination index, so that ILM does not process it. Add the setting back after adding the destination index to the data stream, at which point ILM can safely process it.

(cherry picked from commit f044d97)

# Conflicts:
#	x-pack/plugin/migrate/src/internalClusterTest/java/org/elasticsearch/xpack/migrate/action/ReindexDatastreamIndexTransportActionIT.java
elasticsearchmachine pushed a commit that referenced this pull request Feb 21, 2025
#123071) (#123159)

When reindexing a data stream, remove the lifecycle name setting when creating the destination index, so that ILM does not process it. Add the setting back after adding the destination index to the data stream, at which point ILM can safely process it.

(cherry picked from commit f044d97)

# Conflicts:
#	x-pack/plugin/migrate/src/internalClusterTest/java/org/elasticsearch/xpack/migrate/action/ReindexDatastreamIndexTransportActionIT.java
elasticsearchmachine pushed a commit that referenced this pull request Feb 21, 2025
#123071) (#123158)

When reindexing a data stream, remove the lifecycle name setting when creating the destination index, so that ILM does not process it. Add the setting back after adding the destination index to the data stream, at which point ILM can safely process it.

(cherry picked from commit f044d97)

# Conflicts:
#	x-pack/plugin/migrate/src/internalClusterTest/java/org/elasticsearch/xpack/migrate/action/ReindexDatastreamIndexTransportActionIT.java
elasticsearchmachine pushed a commit that referenced this pull request Mar 6, 2025
… stream (#123071) (#123151)

* Add lifecycle setting to destination index after adding to data stream (#123071)

When reindexing a data stream, remove the lifecycle name setting when creating the destination index, so that ILM does not process it. Add the setting back after adding the destination index to the data stream, at which point ILM can safely process it.

* [CI] Auto commit changes from spotless

* timeout now in request in 9.0

* another silly compilation error

* [CI] Auto commit changes from spotless

---------

Co-authored-by: elasticsearchmachine <[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 backport pending :Data Management/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v8.18.0 v8.18.1 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants