How does elastic search brings back a node which is down

190 Views Asked by At

I was going through elastic search and wanted to get consistent response from ES clusters.

I read Elasticsearch read and write consistency

https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-index_.html

and some other posts and can conclude that ES returns success to write operation after completing writes to all shards (Primary + replica), irrespective of consistency param.

Let me know if my understanding is wrong.

I am wondering if anyone knows, how does elastic search add a node/shard back into a cluster which was down transiently. Will it start serving read requests immediately after it is available or does it ensures it has up to date data before serving read requests?

I looked for the answer to above question, but could not find any.

Thanks Gopal

1

There are 1 best solutions below

2
On

If node is removed from the cluster and it joins again, Elasticsearch checks if the data is up to date. If it is not, then it will not be made available for search, until it is brought up to date again (which could mean the whole shard gets copied again).

the consistency parameter is just an additional pre-index check if the number of expected shards are available in the cluster (if the index is configured to have 4 replicas, then the primary shard plus two replicas need to be available, if set to quorum). However this parameter does never change the behaviour that a write needs to be written to all available shards, before returning to the client.