Locks in elasticsearch
Asked Answered
R

1

5

I tried to find on google but no success.

Can anybody explain at what level elastic search take locks to handle multiple threaded or multi process environment?

Whether it is at index or doctype or a particular document in a doc-type?

Respite answered 7/9, 2015 at 13:27 Comment(0)
L
10

The answer is none of the above. Elasticsearch is based on Lucene which starting with v4.0 (Elasticsearch v1.0) is using lockless concurrent updates. Because there are no locks, you have to rely on optimistic concurrency control if you application need to update the same record at the same time.

It doesn't mean that there are no locks in Elasticsearch though. Some global operation has to be done in a centralized manner. For example, if multiple clients try to create an index with the same name at the same time, only one of them will succeed because this operation affects cluster state and therefore is performed on the master node on a single thread.

Lingam answered 8/9, 2015 at 1:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.