Skip to content

Conversation

@original-brownbear
Copy link
Contributor

@original-brownbear original-brownbear commented Oct 29, 2021

This showed up pretty hot in profiling CS updates for many shards. We are loading+deserializing
lifecycle policies and composable index templates on every CS update which gets expensive
when you do a lot of them and needlessly duplicates the objects as well.
Also, just throwing an unchecked exception on failure to deserialize one of these static resources
seems broken as that's always a bug.

This PR moves all these things to just be statically loaded on classload and makes the index template
registry not show up in profiling CS updates any longer.

Had to move around a couple of things (name SLM code from core to the ILM plugin) for this to work. These moves seem to be a reasonable fix in isolation even though, as we did depend on core ILM to parse the template in the ILM module but didn't have a hard dependency on it there.

relates #77466

This showed up pretty hot in profiling CS updates for many shards. We are loading+deserializing
lifecycle policies and composable index templates on every CS update which gets expensive
when you do a lot of them and needlessly duplicates the objects as well.
Also, just throwing an unchecked exception on failure to deserialize one of these static resources
seems broken as that's always a bug.

This PR moves all these things to just be statically loaded on classload and makes the index template
registry not show up in profiling CS updates any longer.
@original-brownbear original-brownbear added >refactoring :Data Management/ILM+SLM Index and Snapshot lifecycle management v8.0.0 labels Oct 29, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Oct 29, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM

@original-brownbear
Copy link
Contributor Author

Thanks Martijn!

@original-brownbear original-brownbear merged commit 51cee9e into elastic:master Nov 4, 2021
@original-brownbear original-brownbear deleted the static-load-for-template-registry branch November 4, 2021 06:16
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jan 4, 2022
Same as elastic#80086 fixing the monitoring templates which that original
PR forgot.

Relates elastic#77466
original-brownbear added a commit that referenced this pull request Jan 4, 2022
Same as #80086 fixing the monitoring templates which that original
PR forgot.

Relates #77466
astefan pushed a commit to astefan/elasticsearch that referenced this pull request Jan 7, 2022
Same as elastic#80086 fixing the monitoring templates which that original
PR forgot.

Relates elastic#77466
astefan pushed a commit to astefan/elasticsearch that referenced this pull request Jan 7, 2022
Same as elastic#80086 fixing the monitoring templates which that original
PR forgot.

Relates elastic#77466
@original-brownbear original-brownbear restored the static-load-for-template-registry branch April 18, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport pending :Data Management/ILM+SLM Index and Snapshot lifecycle management >refactoring Team:Data Management Meta label for data/management team v8.0.0-beta1 v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants