NOTE
1.8 Elasticsearch Consistency
English translation of the original VNote ‘Elasticsearch Consistency’, preserving its historical parameters, structure, and references.
This is a historical learning note and may contain outdated or incomplete understanding.
1. What Is Consistency?
- Distributed Consistency
- A document in an Elasticsearch Index is first written to the primary shard and then synchronized to replica shards. Consistency here means how to ensure that the data on the primary and replica shards is consistent.
2. The consistency Parameter
2.1. What Is It?
put /index/type/id?consistency=quorum
- one (primary shard)
- The write operation can execute as long as one primary shard is active and available.
- all (all shards)
- The write operation can execute only when all primary shards and replica shards are active.
- quorum (default)
- The default value. A majority of all shards must be active and available before the write operation can execute.
2.2. Purpose
Index operation return when all live/active shards have finished indexing, regardless of consistency param. Consistency param may only prevent the operation to start if there are not enough available shards(nodes).
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub