Clean up all previous indexes after successfully switching to a new one during data refresh #1481
Labels
💻 aspect: code
Concerns the software code in the repository
✨ goal: improvement
Improvement to an existing user-facing feature
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: catalog
Related to the catalog and Airflow DAGs
Problem
If the data refresh fails after the ES indexes are created, they never get cleaned up. This leaves indexes lying around in ES that are unused and useless.
Description
Once we've successfully switched over to the new index at the end of data refresh and we are getting ready to delete the previous index, we could extend that delete operation to be all other indexes aside from the currently used one.
Outstanding questions
Is it wise to immediately delete the previous index after data refresh? Would it be prudent to keep the immediately previous index around but delete any other indexes? If so, would using date versioning for indexes be a good way to track the order of the indexes or does ES keep track of index creation date in a way that would be useful for us to know which indexes are the "current, immediately previous, all others"?
Implementation
The text was updated successfully, but these errors were encountered: