# Elasticsearch indexing while rollover

**URL:** <https://discuss.elastic.co/t/elasticsearch-indexing-while-rollover/112158>\
**Category:** Elasticsearch\
**Created:** [December 18, 2017, 6:14am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-while-rollover/112158 "2017-12-18T06:14:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![khatkar](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@khatkar](https://discuss.elastic.co/u/khatkar)\
**Post date:** [December 18, 2017, 6:14am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-while-rollover/112158/1 "2017-12-18T06:14:55Z")

</div>

I have an application which writes to the ES and which also schedules time based index rollover based on `max_docs` condition.

1. What will happen if I try indexing during the rollover ?
2. Does ES takes lock while performing rollover ?
3. On an average how much time does it take to rollover the index ? Acc. to me this shouldn't take much time as time based index rollover is just creating a new index and pointing the alias to it.

ES version 5.5.1

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 18, 2017, 7:39am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-while-rollover/112158/2 "2017-12-18T07:39:01Z")

</div>

Remember that you are sending your index operation to an alias.

What happens when you rollover:

- It creates a new index (You are still indexing to the old index through the alias)
- It switches the alias. This switch is super fast. If you have a pending operation it might go to the old index.

Once done, the new requests will go to the new index.

There is no lock.

---

<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 15, 2018, 7:39am UTC](https://discuss.elastic.co/t/elasticsearch-indexing-while-rollover/112158/3 "2018-01-15T07:39:20Z")

</div>

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