Removing global retention functionality for templates#108170
Merged
masseyke merged 2 commits intoelastic:mainfrom May 2, 2024
Merged
Removing global retention functionality for templates#108170masseyke merged 2 commits intoelastic:mainfrom
masseyke merged 2 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-data-management (Team:Data Management) |
Member
Author
|
Tagging @gmarouli in case she knows of some reason not to do this. |
dakrone
approved these changes
May 1, 2024
Member
dakrone
left a comment
There was a problem hiding this comment.
LGTM, though maybe Niels wants to take a look also to make sure me didn't miss anything is our discussion about it.
nielsbauman
reviewed
May 2, 2024
...ain/java/org/elasticsearch/action/admin/indices/template/get/GetComponentTemplateAction.java
Outdated
Show resolved
Hide resolved
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.
Currently, templates (Template, ComonentTemplate, and ComposableIndexTemplate) receive a
globalRetentionobject so that (1) when they display the lifecycle we can compute aneffective_retentionfor the lifecycle and (2) when they display the rollover config they can accurately display the rollover time. However, this has two problems:(1) We are exempting system data streams from the global retention settings. Since the template is just a template, and is not applied to a data stream yet, we don't know for sure if it will be applied to a system data stream or to a user data stream
(2) There is an expectation that the fields returned by templates can be updated in a template update. This is not true for retention or rollover time.
This PR stops passing the global retention to templates. Whenever toXContent is called on a lifecycle from a template, null global retention is used. This means that the displayed
effective_retentionand rollover time will be based on whatever retention is configured (or not) in the lifecycle in that template.Relates to #108038 and #106221