# Is index creation API atomic?

**URL:** <https://discuss.elastic.co/t/is-index-creation-api-atomic/189881>\
**Category:** Elasticsearch\
**Created:** [July 10, 2019, 10:07pm UTC](https://discuss.elastic.co/t/is-index-creation-api-atomic/189881 "2019-07-10T22:07:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anfernee\_Xu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anfernee_xu/32/45644_2.png) [@Anfernee\_Xu](https://discuss.elastic.co/u/Anfernee_Xu)\
**Post date:** [July 10, 2019, 10:07pm UTC](https://discuss.elastic.co/t/is-index-creation-api-atomic/189881/1 "2019-07-10T22:07:09Z")

</div>

Is index creation API atomic? As I might have multiple clients trying to create the same index at the same time, can I assume index creation is atomic which mimic POSIX file system?

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [July 11, 2019, 5:01am UTC](https://discuss.elastic.co/t/is-index-creation-api-atomic/189881/2 "2019-07-11T05:01:54Z")

</div>

> [@Anfernee\_Xu](#):
>
> As I might have multiple clients trying to create the same index at the same time, can I assume index creation is atomic

In a way it is atomic, since the new index must be added to the [cluster state](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html) which is controlled by the master node. Even if multiple requests are trying to add a new index to the cluster, only the first one handled by the master node will succeed - all the other requests will fail and return a "resource\_already\_exists\_exception" to the clients.

---

<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:** [August 8, 2019, 5:02am UTC](https://discuss.elastic.co/t/is-index-creation-api-atomic/189881/3 "2019-08-08T05:02:02Z")

</div>

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