-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
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:
Lines 84 to 91 in dc86bab
| 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.