# States condition to be allowed to write into index

**URL:** https://discuss.elastic.co/t/states-condition-to-be-allowed-to-write-into-index/290891
**Category:** Elasticsearch
**Created:** [December 3, 2021, 12:23pm UTC](https://discuss.elastic.co/t/states-condition-to-be-allowed-to-write-into-index/290891 "2021-12-03T12:23:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sebastienf](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@sebastienf](https://discuss.elastic.co/u/sebastienf)
#### Post date: [December 3, 2021, 12:23pm UTC](https://discuss.elastic.co/t/states-condition-to-be-allowed-to-write-into-index/290891/1 "2021-12-03T12:23:20Z")

</div>

Hi,  
I want to bulk-insert into an index.  
This index is made of 3 shards (0, 1, 2) and 1 replica distributed over 2 nodes as follow :

N1:  
shard 0 p  
shard 1 r  
shard 2 p

N2 :  
shard 0 r  
shard 1 p  
shard 2 r

I loose N2 (because of network issue, or something else), the delay is passed and so shard 1 r on N1 become shard 1 p on N1.

When N2 come back, shard 1 r is reindexed.

This situation seems to lead to a freeze of my bulk-insert (it waits a long time to finally falls with this kind a message "all nodes failed").

So, I would like to know what is the normal behaviour behind this kind of situation ? When a replica's missing, what's going on ?

Thanks.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 3, 2021, 12:41pm UTC](https://discuss.elastic.co/t/states-condition-to-be-allowed-to-write-into-index/290891/2 "2021-12-03T12:41:09Z")

</div>

In order to have a highly available cluster that is able to continue accepting writes if one node is lost you need a minimum of three nodes. If you only have 2 master eligible nodes the loss of one node will mean no master can be elected as this requires a strict majority of master eligible nodes to be available and writes will be blocked as a result even if primary shards are available.

---

<div class="post-metadata">

### Author: ![sebastienf](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@sebastienf](https://discuss.elastic.co/u/sebastienf)
#### Post date: [December 6, 2021, 7:25am UTC](https://discuss.elastic.co/t/states-condition-to-be-allowed-to-write-into-index/290891/3 "2021-12-06T07:25:59Z")

</div>

Thank you Christian.

---

<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: [January 3, 2022, 7:26am UTC](https://discuss.elastic.co/t/states-condition-to-be-allowed-to-write-into-index/290891/4 "2022-01-03T07:26:52Z")

</div>

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