2018-10-26 15:19:52 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
2018-08-13 16:15:15 -04:00
|
|
|
[[update-lifecycle-policy]]
|
2020-04-28 19:38:01 -04:00
|
|
|
=== Lifecycle policy updates
|
2018-11-08 18:26:27 -05:00
|
|
|
++++
|
2020-04-28 19:38:01 -04:00
|
|
|
<titleabbrev>Policy updates</titleabbrev>
|
2018-11-08 18:26:27 -05:00
|
|
|
++++
|
2018-08-13 16:15:15 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
You can change how the lifecycle of an index or collection of rolling indices is managed
|
|
|
|
by modifying the current policy or switching to a different policy.
|
2018-10-25 18:24:25 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
To ensure that policy updates don't put an index into a state where it can't exit the current phase,
|
|
|
|
the phase definition is cached in the index metadata when it enters the phase.
|
|
|
|
This cached definition is used to complete the phase.
|
2018-10-25 18:24:25 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
When the index advances to the next phase, it uses the phase definition from the updated policy.
|
2018-10-25 18:24:25 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
[discrete]
|
|
|
|
[[ilm-apply-changes]]
|
|
|
|
=== How changes are applied
|
2018-10-25 18:24:25 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
When a policy is initially applied to an index, the index gets the latest version of the policy.
|
|
|
|
If you update the policy, the policy version is bumped and {ilm-init} can detect that the index
|
|
|
|
is using an earlier version that needs to be updated.
|
2018-10-25 18:24:25 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
Changes to `min_age` are not propagated to the cached definition.
|
|
|
|
Changing a phase's `min_age` does not affect indices that are currently executing that phase.
|
2018-10-25 18:24:25 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
For example, if you create a policy that has a hot phase that does not specify a `min_age`,
|
|
|
|
indices immediately enter the hot phase when the policy is applied.
|
|
|
|
If you then update the policy to specify a `min_age` of 1 day for the hot phase,
|
|
|
|
that has no effect on indices that are already in the hot phase.
|
|
|
|
Indices created _after_ the policy update won't enter the hot phase until they are a day old.
|
2018-10-25 18:24:25 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
[discrete]
|
|
|
|
[[ilm-apply-new-policy]]
|
|
|
|
=== How new policies are applied
|
2018-10-25 18:24:25 -04:00
|
|
|
|
2020-04-28 19:38:01 -04:00
|
|
|
When you apply a different policy to a managed index,
|
|
|
|
the index completes the current phase using the cached definition from the previous policy.
|
|
|
|
The index starts using the new policy when it moves to the next phase.
|