@@ -13,6 +13,9 @@ strategies for newly created indices. It is possible to update policy definition
1313and an index's `index.lifecycle.name` settings independently. To prevent the situation
1414that phase definitions are modified while currently being executed on an index, each index
1515will keep the version of the current phase definition it began execution with until it completes.
16+ This also means that changes to `min_age` will not be propagated. If a new policy is set that
17+ introduces a later `min_age` for the currently executing phase, that new `min_age` will not
18+ be picked up by the update.
1619
1720There are three scenarios for examining the behavior updating policies and
1821their effects on policy execution on indices.
@@ -227,7 +230,85 @@ GET my_index/_ilm/explain
227230// CONSOLE
228231// TESTRESPONSE[skip:no way to know if we will get this response immediately]
229232
230- Updating `my_executing_policy` to have no rollover action and, instead, go directly into a newly introduced `warm` phase.
233+ We can update `my_executing_policy` to enter the hot phase after one day.
234+
235+ [source,js]
236+ ------------------------
237+ PUT _ilm/policy/my_executing_policy
238+ {
239+ "policy": {
240+ "phases": {
241+ "hot": {
242+ "min_age": "1d",
243+ "actions": {
244+ "rollover": {
245+ "max_docs": 1
246+ }
247+ }
248+ },
249+ "delete": {
250+ "min_age": "10d",
251+ "actions": {
252+ "delete": {}
253+ }
254+ }
255+ }
256+ }
257+ }
258+ ------------------------
259+ // CONSOLE
260+ // TEST[continued]
261+
262+ Now, version 2 of this policy has `min_age` for the hot phase set to one day, but if we
263+ run the Explain API again, we will see that nothing has changed. The index `my_index`
264+ is still executing version 1 of the policy.
265+
266+ ////
267+ [source,js]
268+ --------------------------------------------------
269+ GET my_index/_ilm/explain
270+ --------------------------------------------------
271+ // CONSOLE
272+ // TEST[continued]
273+ ////
274+
275+ [source,js]
276+ --------------------------------------------------
277+ {
278+ "indices": {
279+ "my_index": {
280+ "index": "my_index",
281+ "managed": true,
282+ "policy": "my_executing_policy",
283+ "lifecycle_date_millis": 1538475653281,
284+ "phase": "hot",
285+ "phase_time_millis": 1538475653317,
286+ "action": "rollover",
287+ "action_time_millis": 1538475653317,
288+ "step": "check-rollover-ready",
289+ "step_time_millis": 1538475653317,
290+ "phase_execution": {
291+ "policy": "my_executing_policy",
292+ "modified_date_in_millis": 1538475653317,
293+ "version": 1,
294+ "phase_definition": {
295+ "min_age": "0ms",
296+ "actions": {
297+ "rollover": {
298+ "max_docs": 1
299+ }
300+ }
301+ }
302+ }
303+ }
304+ }
305+ }
306+ --------------------------------------------------
307+ // CONSOLE
308+ // TESTRESPONSE[skip:no way to know if we will get this response immediately]
309+
310+ We can also update `my_executing_policy` to have no rollover action and,
311+ instead, go directly into a newly introduced `warm` phase.
231312
232313[source,js]
233314------------------------
@@ -256,7 +337,7 @@ PUT _ilm/policy/my_executing_policy
256337// CONSOLE
257338// TEST[continued]
258339
259- Now, version 2 of this policy has no `hot` phase, but if we run the Explain API again, we will see that nothing has changed.
340+ Now, version 3 of this policy has no `hot` phase, but if we run the Explain API again, we will see that nothing has changed.
260341The index `my_index` is still executing version 1 of the policy.
261342
262343////
@@ -304,7 +385,7 @@ GET my_index/_ilm/explain
304385// TESTRESPONSE[skip:no way to know if we will get this response immediately]
305386
306387After indexing one document into `my_index` so that rollover succeeds and moves onto the next phase, we will notice something new. The
307- index will move into the next phase in the updated version 2 of its policy.
388+ index will move into the next phase in the updated version 3 of its policy.
308389
309390////
310391[source,js]
@@ -338,7 +419,7 @@ GET my_index/_ilm/explain
338419 "phase_execution": {
339420 "policy": "my_executing_policy",
340421 "modified_date_in_millis": 1538475653317,
341- "version": 2 , <1>
422+ "version": 3 , <1>
342423 "phase_definition": {
343424 "min_age": "1d",
344425 "actions": {
@@ -354,7 +435,7 @@ GET my_index/_ilm/explain
354435--------------------------------------------------
355436// CONSOLE
356437// TESTRESPONSE[skip:There is no way to force the index to move to the next step in a timely manner]
357- <1> The index has moved to using version 2 of the policy
438+ <1> The index has moved to using version 3 of the policy
358439
359440`my_index` will move to the next phase in the latest policy definition, which is the newly added `warm` phase.
360441
0 commit comments