Skip to content

Avoid unnecessary LifecycleExecutionState recalculation #81558

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

Merged
merged 10 commits into from
Jan 14, 2022

Conversation

joegallo
Copy link
Contributor

@joegallo joegallo commented Dec 8, 2021

Related to #77466. Extracted and cleaned up from #79692.

Moves LifecycleExecutionState to server/ so that we can have it as a proper field on IndexMetadata, and have that field be calculated at build-time rather than (repeatedly) on-demand.

Reimplement fromIndexMetadata on LifecycleExecutionState in terms of
the newly created method.
Callers should just use the IndexMetadata getter directly.
Instead, eagerly pre-calculate it when an IndexMetadata is built.
Since the LifecycleExecutionState is already always pre-parsed and
available on the IndexMetadata (at build time), there's no longer any
efficiency to be gained by ignoring it and diving directly into the
underlying customData.
@joegallo joegallo force-pushed the ilm-lifecycle-execution-state-rework branch from 87458fa to 2e111e4 Compare January 12, 2022 18:30
@joegallo
Copy link
Contributor Author

Before:

Screen Shot 2022-01-13 at 6 17 39 PM

After:

Screen Shot 2022-01-13 at 6 18 00 PM

fromIndexMetadata is highlighted in the 'before' and if you do meatspace visual diff between the two you can see that it just drops out -- its absence is especially notable in the layer right above triggerPolicies.

@joegallo joegallo marked this pull request as ready for review January 13, 2022 23:23
@joegallo joegallo added the :Data Management/ILM+SLM Index and Snapshot lifecycle management label Jan 14, 2022
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Jan 14, 2022
@elasticmachine
Copy link
Collaborator

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

Copy link
Contributor

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM, this took a while to get through in all details but looks like it's all there and working fine still :) Thanks!

@joegallo joegallo merged commit c6e5c55 into elastic:master Jan 14, 2022
@joegallo joegallo deleted the ilm-lifecycle-execution-state-rework branch January 14, 2022 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement Team:Data Management Meta label for data/management team v8.0.0-rc2 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants