Skip to content

Commit d765296

Browse files
authored
Add note about ILM and Snapshots (#36023)
This commit documents how Index Lifecycle Management interacts with snapshot/restore, and documents a workaround for situations in which ILM should not immediately resume managing an index after it is restored.
1 parent ea7ea51 commit d765296

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[role="xpack"]
2+
[testenv="basic"]
3+
[[index-lifecycle-and-snapshots]]
4+
== Restoring Snapshots of Managed Indices
5+
6+
beta[]
7+
8+
When restoring a snapshot that contains indices managed by Index Lifecycle
9+
Management, the lifecycle will automatically continue to execute after the
10+
snapshot is restored. Notably, the `min_age` is relative to the original
11+
creation or rollover of the index, rather than when the index was restored. For
12+
example, a monthly index that is restored partway through its lifecycle after an
13+
accidental deletion will be continue through its lifecycle as expected: The
14+
index will be shrunk, reallocated to different nodes, or deleted on the same
15+
schedule whether or not it has been restored from a snapshot.
16+
17+
However, there may be cases where you need to restore an index from a snapshot,
18+
but do not want it to automatically continue through its lifecycle, particularly
19+
if the index would rapidly progress through lifecycle phases due to its age. For
20+
example, you may wish to add or update documents in an index before it is marked
21+
read only or shrunk, or prevent an index from automatically being deleted.
22+
23+
To stop lifecycle policy execution on an index restored from a snapshot, before
24+
restoring the snapshot, <<start-stop-ilm,lifecycle policy execution can be
25+
paused>> to allow the policy to be removed.
26+
27+
For example, the following workflow can be used in the above situation to
28+
prevent the execution of the lifecycle policy for an index:
29+
30+
1. Pause execution of all lifecycle policies using the <<ilm-stop,Stop ILM API>>
31+
2. Restore the snapshot.
32+
3. Perform whatever operations you wish before resuming lifecycle execution, or
33+
remove the lifecycle policy from the index using the
34+
<<ilm-remove-policy,Remove Policy from Index API>>
35+
4. Resume execution of lifecycle policies using the <<ilm-start,Start ILM API>>

docs/reference/ilm/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ include::update-lifecycle-policy.asciidoc[]
6464

6565
include::error-handling.asciidoc[]
6666

67+
include::ilm-and-snapshots.asciidoc[]
68+
6769
include::start-stop-ilm.asciidoc[]

0 commit comments

Comments
 (0)