# Refresh\_interval safety

**URL:** <https://discuss.elastic.co/t/refresh-interval-safety/102540>\
**Category:** Elasticsearch\
**Created:** [October 3, 2017, 10:16am UTC](https://discuss.elastic.co/t/refresh-interval-safety/102540 "2017-10-03T10:16:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaharmor](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@shaharmor](https://discuss.elastic.co/u/shaharmor)\
**Post date:** [October 3, 2017, 10:16am UTC](https://discuss.elastic.co/t/refresh-interval-safety/102540/1 "2017-10-03T10:16:03Z")

</div>

Hi,

I know that until the `refresh_interval` of a specific index passes, the docs are not searchable.

But what happens if during that time until the interval, the node dies? Does the replica also holds the same in-memory docs that are stored until the `refresh_interval` is reached, and will it be able to continue from the same position? Or are those documents lost?

---

<div class="post-metadata">

**Author:** ![rockybean](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rockybean/32/11443_2.png) [@rockybean](https://discuss.elastic.co/u/rockybean)\
**Post date:** [October 3, 2017, 11:06am UTC](https://discuss.elastic.co/t/refresh-interval-safety/102540/2 "2017-10-03T11:06:06Z")

</div>

The way that elasticsearch prevents documents lost before refresh is translog. You can learn more from [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-translog.html).

The primary and replica handle documents by themselves. It means that the in-memory docs might be different at the same time but finally it'll be the same.

---

<div class="post-metadata">

**Author:** ![shaharmor](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@shaharmor](https://discuss.elastic.co/u/shaharmor)\
**Post date:** [October 3, 2017, 11:09am UTC](https://discuss.elastic.co/t/refresh-interval-safety/102540/3 "2017-10-03T11:09:14Z")

</div>

So if I set `refresh_interval` to `10m`, and the primary node for the index goes down after 5m, the docs that were indexed during those 5m will still exist

---

<div class="post-metadata">

**Author:** ![rockybean](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rockybean/32/11443_2.png) [@rockybean](https://discuss.elastic.co/u/rockybean)\
**Post date:** [October 3, 2017, 11:12am UTC](https://discuss.elastic.co/t/refresh-interval-safety/102540/4 "2017-10-03T11:12:37Z")

</div>

Of course. Because you have replica node to hold all the documents. Every document will recover from replica node when primary node restarts.

---

<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:** [October 31, 2017, 11:12am UTC](https://discuss.elastic.co/t/refresh-interval-safety/102540/5 "2017-10-31T11:12:45Z")

</div>

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