# Snapshot retention question

**URL:** <https://discuss.elastic.co/t/snapshot-retention-question/254677>\
**Category:** Elasticsearch\
**Created:** [November 8, 2020, 2:23pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677 "2020-11-08T14:23:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 8, 2020, 2:23pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/1 "2020-11-08T14:23:55Z")

</div>

I'm new to ElasticSearch administration. From what I've gathered so far for snapshots is they are always incremental. My question is regarding snapshot retention. The documentation mentions that the snapshots can be configured to be deleted. I'm curious on how that works internally because I was thinking if one snapshot was deleted it would be impossible to recover the data since the data will never be duplicated in another snapshot.

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [November 8, 2020, 3:13pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/2 "2020-11-08T15:13:43Z")

</div>

I think this can answer your question:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/5/3528e222191c3284186f1f431fe8144a568b0a3c.png)  
Deleted test, the file \_0, \_1, \_2 used by test2 would not be deleted. Only file \_3 was deleted.

---

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 8, 2020, 3:22pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/3 "2020-11-08T15:22:37Z")

</div>

Would the data that was in file \_3 be unable to be recovered then since test2 did not have any pointers to it?

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [November 8, 2020, 3:36pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/4 "2020-11-08T15:36:12Z")

</div>

the data in file\_3 was not used by test2 and it can be deleted if you only retention test2 snapshot.

---

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 8, 2020, 3:38pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/5 "2020-11-08T15:38:23Z")

</div>

Oh so the older data that's in test3 would no longer be able to be recovered?

---

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 8, 2020, 3:41pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/6 "2020-11-08T15:41:17Z")

</div>

So you'd set the max retention equal to the max ILM policy date for the indices included in the snapshot?

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [November 8, 2020, 4:02pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/7 "2020-11-08T16:02:22Z")

</div>

Snapshot retention and Index retention , these are two different facets. [This](https://www.elastic.co/cn/blog/found-elasticsearch-snapshot-and-restore) can help you get a closer look at Elasticsearch's snapshot and restore.

---

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 8, 2020, 4:24pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/8 "2020-11-08T16:24:30Z")

</div>

That was very helpful. So it appears that the \_3 file would get merged into the test2 snapshot once the test snapshot was deleted since the \_3 file was not in the test2 snapshot? That would enable that data to be restored.

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [November 8, 2020, 4:35pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/9 "2020-11-08T16:35:42Z")

</div>

The reason \_3 file was not in the test2 snapshot is Merge operation in Elasticsearch.The log in \_3 had been merged into \_4 file when snapshot test2 was created.

---

<div class="post-metadata">

**Author:** ![mwise29](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mwise29](https://discuss.elastic.co/u/mwise29)\
**Post date:** [November 8, 2020, 4:40pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/10 "2020-11-08T16:40:58Z")

</div>

Perfect! Thanks so much for your help. The merge part was what I was missing.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 6, 2020, 4:41pm UTC](https://discuss.elastic.co/t/snapshot-retention-question/254677/11 "2020-12-06T16:41:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
