# Primary shard is closed but still marked as ok and cluster was green

**URL:** <https://discuss.elastic.co/t/primary-shard-is-closed-but-still-marked-as-ok-and-cluster-was-green/75652>\
**Category:** Elasticsearch\
**Created:** [February 19, 2017, 10:42pm UTC](https://discuss.elastic.co/t/primary-shard-is-closed-but-still-marked-as-ok-and-cluster-was-green/75652 "2017-02-19T22:42:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [February 19, 2017, 10:42pm UTC](https://discuss.elastic.co/t/primary-shard-is-closed-but-still-marked-as-ok-and-cluster-was-green/75652/1 "2017-02-19T22:42:41Z")

</div>

During massive delete operation one of the shards (primary) is closed, but marked as ok and cluster was green showing 39 shards of 40 are working. I found what cluster is from logs and see that shard[14] is closed with this error (version 1.7.5):

> [2017-02-19 21:16:47,977][WARN][index.shard] [Bogeyman] [index][14] failed to refresh after setting shard to inactive  
> org.elasticsearch.index.engine.EngineClosedException: [index][14] CurrentState[CLOSED]  
> at org.elasticsearch.index.engine.Engine.ensureOpen(Engine.java:289)  
> at org.elasticsearch.index.engine.InternalEngine.refresh(InternalEngine.java:565)  
> at org.elasticsearch.index.shard.IndexShard.refresh(IndexShard.java:594)  
> at org.elasticsearch.index.shard.IndexShard.updateBufferSize(IndexShard.java:1079)  
> at org.elasticsearch.index.shard.IndexShard.markAsInactive(IndexShard.java:1091)  
> at org.elasticsearch.indices.memory.IndexingMemoryController.markShardAsInactive(IndexingMemoryController.java:405)  
> at org.elasticsearch.indices.memory.IndexingMemoryController$ShardsIndicesStatusChecker.run(IndexingMemoryController.java:297)  
> at org.elasticsearch.threadpool.ThreadPool$LoggingRunnable.run(ThreadPool.java:508)  
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)  
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)  
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
> at java.lang.Thread.run(Thread.java:745)

When I didn't find any way to reopen this shard I stopped ES on this node and was hoping that replica shard will be a primary and then cluster will start building a new replica , but it not worked as expected, same issue happened with newly primary shard (former replica) and now I have 2 shards (primary and replica) closed and cluster is yellow, but not red. I don't find any way to recover the cluster and stopped it entirely and started again, that helped, but why this strange shards behaviour is occurs ?

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 20, 2017, 9:16pm UTC](https://discuss.elastic.co/t/primary-shard-is-closed-but-still-marked-as-ok-and-cluster-was-green/75652/2 "2017-02-20T21:16:10Z")

</div>

What version?

---

<div class="post-metadata">

**Author:** ![Slava\_G](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@Slava\_G](https://discuss.elastic.co/u/Slava_G)\
**Post date:** [February 20, 2017, 10:21pm UTC](https://discuss.elastic.co/t/primary-shard-is-closed-but-still-marked-as-ok-and-cluster-was-green/75652/3 "2017-02-20T22:21:49Z")

</div>

It's 1.7.5  
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:** [March 20, 2017, 10:21pm UTC](https://discuss.elastic.co/t/primary-shard-is-closed-but-still-marked-as-ok-and-cluster-was-green/75652/4 "2017-03-20T22:21:53Z")

</div>

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