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
search-backend-module-elasticsearch: ensure all stale indices are deleted #24682
base: master
Are you sure you want to change the base?
search-backend-module-elasticsearch: ensure all stale indices are deleted #24682
Conversation
Changed Packages
|
Hi @djamaile, thanks for the review! I've re-added |
c800132
to
2dbc917
Compare
|
||
**BREAKING** The ElasticSearch indexer will now delete stale indices matching the indexer's pattern. | ||
|
||
An indexer using the `some-type-index__*` pattern will remove indices matching this pattern after indexation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an action that the adopter should take before upgrading to this new version? For example, updating their index patterns 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an action to verify that the pattern isn't conflicting with other indices not managed by Backstage
(which should already be an "issue" since the indexer removes aliases on these indices)
2dbc917
to
ab43b4b
Compare
Thanks for the contribution! |
ab43b4b
to
4a08cc0
Compare
…re deleted Signed-off-by: Thomas Cardonne <thomas.cardonne@adevinta.com>
Signed-off-by: Thomas Cardonne <thomas.cardonne@adevinta.com>
Signed-off-by: Thomas Cardonne <thomas.cardonne@adevinta.com>
Signed-off-by: Thomas Cardonne <thomas.cardonne@adevinta.com>
4a08cc0
to
f5d433a
Compare
Signed-off-by: Thomas Cardonne <thomas.cardonne@adevinta.com>
f5d433a
to
5eba6fc
Compare
Hi @djamaile, I've updated the PR to handle deletion in chunks of 50 indices to fix an issue that can occur when having a lot of stale indices to delete. The indices delete method in ES/OS clients generate a Let me know if something's needed to move this forward! |
Hey, I just made a Pull Request!
We ran into a case where the indexer would fail but leave a half-filled index without deleting it (#24680 should allow us to understand why).
As indices are not deleted, we're exhausting the allowed number of shards on our OpenSearch cluster.
This PR changes the way stale indices are cleaned. Instead of relying on aliases, we simply list indices that match the indexer's pattern (
some-type-index__*
) and delete them after indexation.I've marked the change as breaking because someone may use
some-type-index__some-index-that-shouldnt-be-deleted
as an index name (not managed by Backstage Search).However the wildcard pattern is already used to remove aliases, so IMHO we can commit to use the pattern to detect and delete stale indices.
✔️ Checklist
Added or updated documentationScreenshots attached (for UI changes)Signed-off-by
line in the message. (more info)