Skip to content

Removing global retention functionality for templates#108170

Merged
masseyke merged 2 commits intoelastic:mainfrom
masseyke:no-global-retention-for-templates
May 2, 2024
Merged

Removing global retention functionality for templates#108170
masseyke merged 2 commits intoelastic:mainfrom
masseyke:no-global-retention-for-templates

Conversation

@masseyke
Copy link
Copy Markdown
Member

@masseyke masseyke commented May 1, 2024

Currently, templates (Template, ComonentTemplate, and ComposableIndexTemplate) receive a globalRetention object so that (1) when they display the lifecycle we can compute an effective_retention for 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_retention and rollover time will be based on whatever retention is configured (or not) in the lifecycle in that template.

Relates to #108038 and #106221

@masseyke masseyke added >non-issue :StorageEngine/Data streams Data streams and their lifecycles v8.15.0 labels May 1, 2024
@masseyke masseyke requested review from dakrone and nielsbauman May 1, 2024 21:13
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label May 1, 2024
@masseyke
Copy link
Copy Markdown
Member Author

masseyke commented May 1, 2024

Tagging @gmarouli in case she knows of some reason not to do this.

Copy link
Copy Markdown
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though maybe Niels wants to take a look also to make sure me didn't miss anything is our discussion about it.

@masseyke masseyke requested a review from nielsbauman May 2, 2024 13:13
Copy link
Copy Markdown
Contributor

@nielsbauman nielsbauman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@masseyke masseyke merged commit df8a3cf into elastic:main May 2, 2024
@masseyke masseyke deleted the no-global-retention-for-templates branch May 2, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :StorageEngine/Data streams Data streams and their lifecycles Team:Data Management (obsolete) DO NOT USE. This team no longer exists. v8.15.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants