Elasticsearch data consistency

1.Es create a document 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 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?

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.


Thank you.

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