SRCH-5887: Added Elasticsearch ILM polices#1837
Draft
igoristic wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for managing Elasticsearch index retention using https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html. It ensures that an ILM policy is created or updated, applied to a matching index template, and attached to both new and existing indices.
More details here: https://docs.google.com/document/d/1nhWg50eILV1_tglNJDl-gUk-SBy6D7Gr3raimCygnC4/edit?tab=t.0
Key enhancements:
ILM Policy Details
min_age: 0ms), sets index priority.SEARCHELASTIC_INDEX_RETENTION_MIN_AGE, deletes the index.How to Test
You can test ILM in a staging or dev environment using a short retention window to verify it’s working as expected.
Set a small retention age in your environment (e.g. 1 hour):
Create the index by running the Rails method:
Confirm ILM policy is attached:
curl -X GET localhost:9200/spider-searchgov/_ilm/explain?prettyAfter 1 hour, confirm that the index is automatically deleted.
Note:
Functionality Checks
You have merged the latest changes from the target branch (usually
main) into your branch.Your primary commit message is of the format SRCH-#### <description> matching the associated Jira ticket.
PR title is either of the format SRCH-#### <description> matching the associated Jira ticket (i.e. "SRCH-123 implement feature X"), or Release - SRCH-####, SRCH-####, SRCH-#### matching the Jira ticket numbers in the release.
Automated checks pass. If Code Climate checks do not pass, explain reason for failures:
Process Checks