Skip to content

Truncate step_info and error reason in ILM execution state and history #125054

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 6 commits into from
Mar 18, 2025

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Mar 17, 2025

This commit adds a limit to the step_info contained in LifecycleExcutionState so that large step info messages will not be stored in the cluster state. Additionally, when generating an ILM history failure, the full exception that is "stringified" is truncated to the same limit, ensuring that we do not accidentally index gigantic documents in the history store.

The default limit is 1024 characters.

Resolves #124181

This commit adds a limit to the `step_info` contained in `LifecycleExcutionState` so that large step
info messages will not be stored in the cluster state. Additionally, when generating an ILM history
failure, the full exception that is "stringified" is truncated to the same limit, ensuring that we
do not accidentally index gigantic documents in the history store.

The default limit is 1024 characters.

Resolves elastic#124181
@dakrone dakrone added >enhancement :Data Management/ILM+SLM Index and Snapshot lifecycle management v8.19.0 v9.1.0 labels Mar 17, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Mar 17, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @dakrone, I've created a changelog YAML for you.

Copy link
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.

Left one non-blocking suggestion, other than that LGTM.

@@ -308,7 +310,7 @@ public Builder setFailedStep(String failedStep) {
}

public Builder setStepInfo(String stepInfo) {
this.stepInfo = stepInfo;
this.stepInfo = Strings.cleanTruncate(stepInfo, MAXIMUM_STEP_INFO_STRING_LENGTH);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be valuable to add some truncation information to the string, i.e. ... x chars more or ... x chars truncated. If someone is looking at these step infos (from the API or the history), I think it would be valuable to know for sure that the string was truncated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, I added this!

@dakrone dakrone added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport Automatically create backport pull requests when merged labels Mar 18, 2025
@elasticsearchmachine elasticsearchmachine merged commit cda2669 into elastic:main Mar 18, 2025
17 checks passed
@dakrone dakrone deleted the truncate-long-ILM-errors branch March 18, 2025 17:45
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

dakrone added a commit to dakrone/elasticsearch that referenced this pull request Mar 18, 2025
elastic#125054)

This commit adds a limit to the `step_info` contained in
`LifecycleExcutionState` so that large step info messages will not be
stored in the cluster state. Additionally, when generating an ILM
history failure, the full exception that is "stringified" is truncated
to the same limit, ensuring that we do not accidentally index gigantic
documents in the history store.

The default limit is 1024 characters.

Resolves elastic#124181
elasticsearchmachine pushed a commit that referenced this pull request Mar 18, 2025
#125054) (#125140)

This commit adds a limit to the `step_info` contained in
`LifecycleExcutionState` so that large step info messages will not be
stored in the cluster state. Additionally, when generating an ILM
history failure, the full exception that is "stringified" is truncated
to the same limit, ensuring that we do not accidentally index gigantic
documents in the history store.

The default limit is 1024 characters.

Resolves #124181
smalyshev pushed a commit to smalyshev/elasticsearch that referenced this pull request Mar 21, 2025
elastic#125054)

This commit adds a limit to the `step_info` contained in
`LifecycleExcutionState` so that large step info messages will not be
stored in the cluster state. Additionally, when generating an ILM
history failure, the full exception that is "stringified" is truncated
to the same limit, ensuring that we do not accidentally index gigantic
documents in the history store.

The default limit is 1024 characters.

Resolves elastic#124181
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
elastic#125054)

This commit adds a limit to the `step_info` contained in
`LifecycleExcutionState` so that large step info messages will not be
stored in the cluster state. Additionally, when generating an ILM
history failure, the full exception that is "stringified" is truncated
to the same limit, ensuring that we do not accidentally index gigantic
documents in the history store.

The default limit is 1024 characters.

Resolves elastic#124181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement Team:Data Management Meta label for data/management team v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ILM LifecycleExecutionState#stepInfo adds unbounded data to cluster state
3 participants