# Concurrent document create with \_version

**URL:** <https://discuss.elastic.co/t/concurrent-document-create-with--version/52797>\
**Category:** Elasticsearch\
**Created:** [June 15, 2016, 1:47am UTC](https://discuss.elastic.co/t/concurrent-document-create-with--version/52797 "2016-06-15T01:47:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mashbourne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mashbourne/32/10328_2.png) [@mashbourne](https://discuss.elastic.co/u/mashbourne)\
**Post date:** [June 15, 2016, 1:47am UTC](https://discuss.elastic.co/t/concurrent-document-create-with--version/52797/1 "2016-06-15T01:47:12Z")

</div>

Hi,

I'm using optimistic locking with the version field to avoid update anomalies. We also roll indexes in our cluster based on time/size.

I was wondering whether the unique \_id and versioning constraints are maintained across indexes when accessed through an alias... Trying to track down the source of an update anomaly.

Thanks!

---

<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:** [June 15, 2016, 2:45am UTC](https://discuss.elastic.co/t/concurrent-document-create-with--version/52797/2 "2016-06-15T02:45:20Z")

</div>

They are per shard. If you roll the index or use bad routing you can have  
trouble.

---

<div class="post-metadata">

**Author:** ![mashbourne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mashbourne/32/10328_2.png) [@mashbourne](https://discuss.elastic.co/u/mashbourne)\
**Post date:** [June 15, 2016, 3:03am UTC](https://discuss.elastic.co/t/concurrent-document-create-with--version/52797/3 "2016-06-15T03:03:16Z")

</div>

We aren't using any custom routing. So if we don't roll this index, and just let it grow shards by itself, are we safe?

---

<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:** [July 5, 2017, 10:43pm UTC](https://discuss.elastic.co/t/concurrent-document-create-with--version/52797/4 "2017-07-05T22:43:49Z")

</div>


