# 2.3.4 write behaviour with replicas set to 2

**URL:** <https://discuss.elastic.co/t/2-3-4-write-behaviour-with-replicas-set-to-2/97140>\
**Category:** Elasticsearch\
**Created:** [August 15, 2017, 5:24pm UTC](https://discuss.elastic.co/t/2-3-4-write-behaviour-with-replicas-set-to-2/97140 "2017-08-15T17:24:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bw99](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bw99](https://discuss.elastic.co/u/bw99)\
**Post date:** [August 15, 2017, 5:24pm UTC](https://discuss.elastic.co/t/2-3-4-write-behaviour-with-replicas-set-to-2/97140/1 "2017-08-15T17:24:11Z")

</div>

Hi all,

I am trying to understand the behaviour of ES 2.3.4 when replicas are set to 2.

The docs say that "index operations only succeed if a quorum (\>replicas/2+1) of active shards are available."

I'm confused by what 'active' and 'available' mean in this context.

On my naive reading, it sounds like an index operation will fail unless all 3 shards are available (1 primary and 2 replicas) because 'quorum' means \>replicas/2+1, which in my case means \>2, which means 3 must be available.

If one node on my 5 node cluster fails, does that mean that I won't be able to index documents until all shards have 2 replicas available again? That's not really what I was hoping for - I was hoping that by having 2 replicas, I was insulated against a node failing, but it seems that a node failing means all indexing stops until the cluster is fully healed again?

I see that I can also set write consistency to 'one' - will that alter the behaviour of the system if one node fails?

Thanks!

---

<div class="post-metadata">

**Author:** ![bw99](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bw99](https://discuss.elastic.co/u/bw99)\
**Post date:** [August 15, 2017, 5:47pm UTC](https://discuss.elastic.co/t/2-3-4-write-behaviour-with-replicas-set-to-2/97140/2 "2017-08-15T17:47:28Z")

</div>

Hmm. In the 5.5 docs, it defines a quorum as follows:

" A quorum is defined as follows:

int( (primary + number\_of\_replicas) / 2 ) + 1  
The allowed values for consistency are one (just the primary shard), all (the primary and all replicas), or the default quorum, or majority, of shard copies.

Note that the number\_of\_replicas is the number of replicas specified in the index settings, not the number of replicas that are currently active"

If that is the same definition as 2.3.4 uses, then (\>replicas/2+1) still means \>2, using 'replicas' to include the primary shard.

Bit confusing, but hopefully can continue to index even when one node goes down, because perhaps only 2 active shards are required. The error message is also ambiguous:

"Not enough active copies to meet write consistency of [QUORUM] (have 1, needed 2)"

If I have 1 primary and 2 replicas, is that 2 active copies or 3??

---

<div class="post-metadata">

**Author:** ![bw99](https://avatars.discourse-cdn.com/v4/letter/b/e9a140/32.png) [@bw99](https://discuss.elastic.co/u/bw99)\
**Post date:** [August 15, 2017, 7:38pm UTC](https://discuss.elastic.co/t/2-3-4-write-behaviour-with-replicas-set-to-2/97140/3 "2017-08-15T19:38:13Z")

</div>

OK, answering my own question. With replicas set to 2, it happily indexes documents when only 1 replica is available, so my guess is that the definition "quorum = \>replicas/2+1" is incorrect.

So far in my experience, you can index documents with the quorum write behaviour:

with 0 available replicas when number of replicas is set to 0  
with 0 available replicas when number of replicas is set to 1  
with 1 available replica when number of replicas is set to 2

---

<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:** [September 12, 2017, 7:38pm UTC](https://discuss.elastic.co/t/2-3-4-write-behaviour-with-replicas-set-to-2/97140/4 "2017-09-12T19:38:16Z")

</div>

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