Elasticsearch 7.x closed indices retain shards

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?

Yes, this is the effect of the replicated closed indices feature introduced in 7.2.0.

You may also want to look at using frozen indices as these like closed indices do not consume resources but still are available for search.

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

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.

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.

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