# Writes with offline primary and no replicas

**URL:** <https://discuss.elastic.co/t/writes-with-offline-primary-and-no-replicas/222346>\
**Category:** Elasticsearch\
**Created:** [March 5, 2020, 5:00pm UTC](https://discuss.elastic.co/t/writes-with-offline-primary-and-no-replicas/222346 "2020-03-05T17:00:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![reighnman](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@reighnman](https://discuss.elastic.co/u/reighnman)\
**Post date:** [March 5, 2020, 5:00pm UTC](https://discuss.elastic.co/t/writes-with-offline-primary-and-no-replicas/222346/1 "2020-03-05T17:00:25Z")

</div>

I had a ticket open with support on this but they could not explain what would happen so trying here.

Single index, multiple primaries spread across multiple nodes, 0 replicas. Do writes continue if 1 of the primaries of an index is offline or does the index become un-writeable?

For example in my test, I created an index with 2 primary shards (P0/1) and 0 replicas. The primaries are distributed across node A and B.

While indexing data I stopped the service on B, thus P1 becomes unassigned/unavailable. As there are no replicas to become primaries the cluster goes red. Search results immediately show half the data as expected, but it looks like writes also stopped which is surprising.

I would have assumed all writes would have gone to the remaining active primary shard that was still available?

---

<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:** [March 5, 2020, 5:10pm UTC](https://discuss.elastic.co/t/writes-with-offline-primary-and-no-replicas/222346/2 "2020-03-05T17:10:31Z")

</div>

That sounds like the correct and expected behaviour. Writing to red indices is not allowed. This has to be the case as updates and deletes are supported.

---

<div class="post-metadata">

**Author:** ![reighnman](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@reighnman](https://discuss.elastic.co/u/reighnman)\
**Post date:** [March 5, 2020, 5:12pm UTC](https://discuss.elastic.co/t/writes-with-offline-primary-and-no-replicas/222346/3 "2020-03-05T17:12:39Z")

</div>

Thanks!

---

<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:** [April 2, 2020, 5:12pm UTC](https://discuss.elastic.co/t/writes-with-offline-primary-and-no-replicas/222346/4 "2020-04-02T17:12:45Z")

</div>

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