# Will “merge api” affect “\_snapshot”?

**URL:** https://discuss.elastic.co/t/will-merge-api-affect-snapshot/162104
**Category:** Elasticsearch
**Created:** [December 26, 2018, 7:40am UTC](https://discuss.elastic.co/t/will-merge-api-affect-snapshot/162104 "2018-12-26T07:40:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![xyx](https://avatars.discourse-cdn.com/v4/letter/x/eb8c5e/32.png) [@xyx](https://discuss.elastic.co/u/xyx)
#### Post date: [December 26, 2018, 7:40am UTC](https://discuss.elastic.co/t/will-merge-api-affect-snapshot/162104/1 "2018-12-26T07:40:11Z")

</div>

Will “merge api” affect “\_snapshot”?  
When I used \_snapshot to backup my index.And then use "merge api" to merge segments.  
Does this operate will cause some problems.In other words，the data will not correct.

---

<div class="post-metadata">

### Author: ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)
#### Post date: [December 26, 2018, 5:10pm UTC](https://discuss.elastic.co/t/will-merge-api-affect-snapshot/162104/2 "2018-12-26T17:10:54Z")

</div>

Merge shouldn't make any data incorrect. However, since snapshot is based on segments and only copies over segments that were modified since the last snapshot, calling force merge will cause all segments to be overridden, so the next snapshot after this operation will have to copy over the entire index.

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [December 26, 2018, 5:14pm UTC](https://discuss.elastic.co/t/will-merge-api-affect-snapshot/162104/3 "2018-12-26T17:14:04Z")

</div>

You can snapshot at the same time as you merge, sure. If merge wants to delete a file that is needed by the snapshot then the file will stick around until the snapshot is done and then be cleaned up. It should be fine. And happens all the time in the background actually.

---

<div class="post-metadata">

### Author: ![xyx](https://avatars.discourse-cdn.com/v4/letter/x/eb8c5e/32.png) [@xyx](https://discuss.elastic.co/u/xyx)
#### Post date: [December 27, 2018, 5:32am UTC](https://discuss.elastic.co/t/will-merge-api-affect-snapshot/162104/4 "2018-12-27T05:32:25Z")

</div>

Thanks

---

<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: [January 24, 2019, 5:32am UTC](https://discuss.elastic.co/t/will-merge-api-affect-snapshot/162104/5 "2019-01-24T05:32:32Z")

</div>

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