Skip to content

CopyExecutionStateStep does not copy all execution state within ILM #73791

@dakrone

Description

@dakrone

When a new index is created internally within ILM (the shrink and searchable_snapshot actions), ILM copies the execution state from the original to the new index. This usually works fine, however, this copying only includes a subset of the LifecycleExecutionState:

relevantTargetCustomData.setIndexCreationDate(lifecycleDate);
relevantTargetCustomData.setAction(action);
relevantTargetCustomData.setPhase(phase);
relevantTargetCustomData.setStep(step);
relevantTargetCustomData.setSnapshotRepository(lifecycleState.getSnapshotRepository());
relevantTargetCustomData.setSnapshotName(lifecycleState.getSnapshotName());
relevantTargetCustomData.setSnapshotIndexName(lifecycleState.getSnapshotIndexName());
relevantTargetCustomData.setShrinkIndexName(lifecycleState.getShrinkIndexName());

This is problematic though, as some other parts of the execution state are not only useful for debugging (such as phase/action/step timings), but needed for execution, such as the phase_definition JSON. This means that if an index was in the warm phase with a shrink step, and then the shrink action were removed from the policy, the new index created from the shrink (due to the caching) would not be able to execute steps once it was created, because those steps would no longer exist in the policy.

Instead, we should copy the entire lifecycle execution state when a new index is created.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions