While investigating a node with shards on disk not referenced as "active" by the cluster, I found an allocation state: unused
.
This state is referenced in the documentation, however I found no explanation about it.
The status of the store copy, whether it is used as a primary, replica or not used at all
Can someone please explain the purpose(s) of it?
Edit: Given comments it should be noted that the cluster was green and all primaries and replicas of all indices were present at the time I found those unused shards.
As of now all these shards in unused
state (some were older than a year) disappeared. The operation that happened was to reduce replication on an index. This operation removed all unused shards even if they belonged to other indices. It should be noted that every month a new index is created and another is deleted so previously mentioned operation does not seem to explain the behavior solely.