Automatic deletion of read only indices with 0 documents

I have index lifecycle policy (hot phase 1 month -> warm phase 1 year -> delete phase)
My index has 2 primary shards + 1 replica (4 shards in total).
Sometimes it happens that my index has 0 documents and it rolls over after 1 month to warm phase and becomes read only.
General advice is to have 1GB per 20 shards. Should my index in warm phase (that has 0 documents and 4 shards) also be taken into account in this calculation ?
Is it possible to automatically delete indices that have 0 documents and are in warm phase and are read only?
Does shrink or force merge help a bit in such situation?

Welcome to our community! :smiley:

An empty shard is always wasteful. There's no logic in ILM to let you say "if 0 docs then delete", so you'd need something external to do that.

You can also create a feature request on GitHub for ILM to handle this in a future version.

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