# Elasticsearch 7.x closed indices retain shards

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969>\
**Category:** Elasticsearch\
**Created:** [June 28, 2019, 4:17am UTC](https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969 "2019-06-28T04:17:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![trenta](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@trenta](https://discuss.elastic.co/u/trenta)\
**Post date:** [June 28, 2019, 4:17am UTC](https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969/1 "2019-06-28T04:17:42Z")

</div>

Prior to version 7, when I closed an index it would release any shards that were used and turn the status of that index to black. Since version 7 when I close an index it is labeled as closed but still has a green status and shards assigned.

Does anyone have an explanation for this?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 28, 2019, 5:26am UTC](https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969/2 "2019-06-28T05:26:07Z")

</div>

Yes, this is the effect of the [replicated closed indices feature](https://github.com/elastic/elasticsearch/issues/33888) introduced in 7.2.0.

---

<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:** [June 28, 2019, 5:28am UTC](https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969/3 "2019-06-28T05:28:10Z")

</div>

You may also want to look at using [frozen indices](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/frozen-indices.html) as these like closed indices do not consume resources but still are available for search.

---

<div class="post-metadata">

**Author:** ![trenta](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@trenta](https://discuss.elastic.co/u/trenta)\
**Post date:** [June 28, 2019, 5:59am UTC](https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969/4 "2019-06-28T05:59:17Z")

</div>

Thanks for the responses. I like the look of the frozen indices but that still doesn't deal with the number of open indices. Is there anyway now to have indices without shards assigned even if they are unsearchable. I want to keep old data but not live. That's why I liked the closed indices in previous versions.

Cheers

---

<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:** [June 28, 2019, 6:02am UTC](https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969/5 "2019-06-28T06:02:54Z")

</div>

Then continue using closed indices. In previous versions Elasticsearch would not keep track of closed indices and would not replicate them if a node failed and a copy disappeared. For use cases with large amounts of closed indices, a few node failures with lost storage over time could lead to data loss as all primary and replica shards for a closed shard might have been lost in the process. The change you now see allows Elasticsearch to make sure enough copies exist also of closed indices.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 28, 2019, 6:16am UTC](https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969/6 "2019-06-28T06:16:58Z")

</div>

An assigned shard in a closed index is a very lightweight thing. Elasticsearch now keeps track of them in order to rebuild lost copies, free disk space on overfull nodes, etc. but they are still shards of a closed index. All of the expensive data structures needed for searching or indexing are missing.

---

<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:** [July 26, 2019, 6:17am UTC](https://discuss.elastic.co/t/elasticsearch-7-x-closed-indices-retain-shards/187969/7 "2019-07-26T06:17:05Z")

</div>

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