-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[event log] ILM policy still active for older indices no longer active #97755
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
Would also be nice to have some manual work-around for customers that do want this cleaned up. Like, can we just delete these indices, and then it'll stop? I think so ... |
Was thinking that we could do something like this, as a recurring task "cleanup the old empty event log indices":
One potential problem with this is that if a customer somehow migrated to a new Kibana version, and the task deleted all the event log indices for the version they were previously on, and then for some reason the customer decided to migrate DOWN to an old Kibana version, we'd be in trouble. Because we'd then be using an alias which pointed to a non-existant index, and I'm guessing something would likely go wrong. I know that migrating down is not really supported. And it's likely that, upon migration, there would be non-empty event log indices that would survive the clean up tasks. So it seems to me that even if we did nothing special about this, things would likely work out fine. But it's also likely true you can imagine a case where it would do something bad. Perhaps we could have the cleanup task recognize when there are versions of the event log resources that are at a version > than the current stack version, and provide a warning. Might be difficult to future proof, since we don't know how we might change these resource names in the future. Maybe we should provide version info in the resource metadata, where possible? And then this makes me wonder about the index template and aliases. We should probably delete these as well, during the cleanup, if we recognize there are no indices left after cleaning up the indices. Seems to me that would likely work out fine. In that case, Kibana would start up, not see any of the alias, template, or initial index, and so re-create them. |
I wonder if there's a way for these indices to be created lazily? That way, customers who don't use the event log don't have indices created. I'm not sure if ILM is the blocker for such capability. |
Submitted a PR for removing older event log indices from being managed by ILM, but @chrisronline correctly pointed out that while this would mean older indices would not roll over needlessly and create empty indices, they would also not age off after 90 days and they would stick around forever, which is not the behavior we want either. Will investigate creating a cleanup task for this next. |
What if we applied a separate ILM policy for these indices? Something that just automatically deletes in the same period but doesn't have any rollover? |
After doing a bit of research, this sounds like a limitation of ILM at this time. However, I came across elastic/elasticsearch#73349, which requests the rollover process to also clean up empty indices. What are your thoughts on relying on that ES ticket and add our +1 instead of developing a workaround? |
@mikecote Nice find! I only managed to find this issue where it looked like an issue that would not be addressed. I am in agreement that we should wait for that issue vs developing a workaround. |
Great, I'm +1 if we want to close this issue in favour of the Elasticsearch ones and forward any feedback to those. |
Closing in favor of waiting for elastic/elasticsearch#73349 to be resolved |
Report from the field about numerous empty event log indices for older versions of Kibana that have been migrated from.
example:
list of event log indices found in the wild
Apparently, the old versions of the indices are still "live" in terms of ILM, so keep rolling over, and deleting themselves, but basically leaving a fixed set of the old ones around - 4 per version it appears.
We should look into how we could fix this, so that once there are no docs in any of the version-specific indices, we turn off ILM. Hopefully there's an ILM config for this, otherwise we may need to do this "by hand".
The text was updated successfully, but these errors were encountered: