# Elasticsearch data consistency

**URL:** <https://discuss.elastic.co/t/elasticsearch-data-consistency/66070>\
**Category:** Elasticsearch\
**Created:** [November 15, 2016, 8:05am UTC](https://discuss.elastic.co/t/elasticsearch-data-consistency/66070 "2016-11-15T08:05:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![famoss](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@famoss](https://discuss.elastic.co/u/famoss)\
**Post date:** [November 15, 2016, 8:05am UTC](https://discuss.elastic.co/t/elasticsearch-data-consistency/66070/1 "2016-11-15T08:05:32Z")

</div>

1.[Es create a document](https://www.elastic.co/guide/en/elasticsearch/guide/current/distrib-write.html) says:

> Node 3 executes the request on the primary shard. If it is successful, it forwards the request in parallel to the replica shards on Node 1 and Node 2. **Once all of the replica shards report success** , Node 3 reports success to the coordinating node, which reports success to the client.

But,next `consistency` says:

> default quorum, or majority

If i have 2 replica shard,i think es just need one replica shard report success instead of ` all of the replica shards report success`?

2.[Retrieving a Document](https://www.elastic.co/guide/en/elasticsearch/guide/current/distrib-read.html) says:

> For read requests, the coordinating node will choose a different shard copy on every request in order to balance the load; it round-robins through all shard copies.

So,if one replica shard index a doc error and another success,i will get different result from different shards?

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [November 15, 2016, 2:08pm UTC](https://discuss.elastic.co/t/elasticsearch-data-consistency/66070/2 "2016-11-15T14:08:22Z")

</div>

Hi,  
consistency is not the best wording (which we will change in future versions). This is not about whether the operation is successful or not. A write operation cannot be rolled back anyways. It is a pre-write check to verify that we have enough available copies of the shard that we have to write into. With 2 replicas, we need to have available the primary and one replica for the write operation to come through. Otherwise the write will be rejected as a whole, it won't be executed in the primary either.

This should also answer you question on read operations.

Cheers  
Luca

---

<div class="post-metadata">

**Author:** ![famoss](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@famoss](https://discuss.elastic.co/u/famoss)\
**Post date:** [November 16, 2016, 1:00am UTC](https://discuss.elastic.co/t/elasticsearch-data-consistency/66070/3 "2016-11-16T01:00:30Z")

</div>

Thank you.

---

<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:** [December 14, 2016, 1:00am UTC](https://discuss.elastic.co/t/elasticsearch-data-consistency/66070/4 "2016-12-14T01:00:43Z")

</div>

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