What happens when multiple users index into same index and type with same document ids?

All,

I am curious to know what happens in the following case,
Two users indexing into
same index, say Index1
same type, say Type1
and they both try to index a document specifying the same id say id1.

What happens in this case? How does this scale out?

Thanks

There will be a collision and you will get version conflict error. :slight_smile:

Not exactly. Not by default.

The last write operation will win and will overwrite the previous one.

If you want to have optimistic locking, add the expected version number as explained here: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-index_.html#index-versioning

2 Likes

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