Open pickypg opened 3 years ago
Pinging @elastic/es-core-features (Team:Core/Features)
This would be such a great feature. In the meantime could it be done with a watcher? Deleting indices in warm with zero documents
This would be such a great feature. In the meantime could it be done with a watcher? Deleting indices in warm with zero documents
Yes. Watches can be scripted to poll pretty much anything, then perform arbitrary actions (like a DELETE
request).
It would be nice if rollover supported automatically deleting the previous index if it is empty after the alias shuffle, either via Rollover or ILM.
While checking up on one of the clusters that I maintain, I came across this subset of relevant indices:
Note that the vast majority of the non-latest indexes are empty.
There's a clear pattern of internal indices (there's obviously nothing special about internal indices that triggers this behavior) where they leave a bunch of empty indices behind due to time. It's not necessarily a bad idea to rollover due to time, regardless of size, to take advantage of ES upgrades and template changes, but leaving around empty indices is clearly wasteful and unhelpful.
In the above example, there are more empty indices than there are documents. With an autodelete feature, there would be at-most
12
indices versus the19
that exist. It would be even more ideal if there was a system in place to help the index version names (e.g.,history-1
tohistory-3
) that was also understood by ILM / Rollover to avoid those unneeded transitionary indices as well.