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


(siva ramalingam) #1

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


(Mujtaba Hussain) #2

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


(David Pilato) #3

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


(system) #4

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