-
Notifications
You must be signed in to change notification settings - Fork 25k
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
[ILM] Fix downsample to skip already downsampled indices #102250
[ILM] Fix downsample to skip already downsampled indices #102250
Conversation
This fixes a bug in ILM where if an ILM policy is updated such that the next phase (e.g. warm) contains the downsample action from the previous phase (e.g. hot), whilst the managed index is waiting to enter the next phase (e.g. warm), if the managed index was already downsampled in hot it would get deleted in the warm phase.
Hi @andreidan, I've created a changelog YAML for you. |
Pinging @elastic/es-data-management (Team:Data Management) |
if (downsampleStatus == IndexMetadata.DownsampleTaskStatus.UNKNOWN) { | ||
// This isn't a downsample index, but it has the name of our target downsample index - very bad, we'll skip the | ||
// downsample action to avoid blocking the lifecycle of this index - if there | ||
// is another downsample action configured in the next phase, it'll be able to proceed successfully | ||
logger.warn( | ||
"index [{}] as part of policy [{}] cannot be downsampled at interval [{}] in phase [{}] because it has" | ||
+ " the name of the target downsample index and is itself not a downsampled index. Skipping the downsample " | ||
+ "action.", | ||
index.getName(), | ||
indexMetadata.getLifecyclePolicyName(), | ||
fixedInterval, | ||
phase | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, why do we only log this warning if the status is unknown, if the status is successful we still skip this downsample, but we don't log about it. Shouldn't we log in all cases then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the status is successful we don't log anything because this action (even as a no-op) has achieve its goal - the index is downsampled at the desired /configured interval.
If the index has the shape of a downsample index, but it is not (i.e. status is UNKNOWN) we're skipping this action without achieving its goal - i.e. the data is not downsampled. We're logging the warning that we haven't executed downsampling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, thanks for the explanation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for fixing this Andrei
if (downsampleStatus == IndexMetadata.DownsampleTaskStatus.UNKNOWN) { | ||
// This isn't a downsample index, but it has the name of our target downsample index - very bad, we'll skip the | ||
// downsample action to avoid blocking the lifecycle of this index - if there | ||
// is another downsample action configured in the next phase, it'll be able to proceed successfully | ||
logger.warn( | ||
"index [{}] as part of policy [{}] cannot be downsampled at interval [{}] in phase [{}] because it has" | ||
+ " the name of the target downsample index and is itself not a downsampled index. Skipping the downsample " | ||
+ "action.", | ||
index.getName(), | ||
indexMetadata.getLifecyclePolicyName(), | ||
fixedInterval, | ||
phase | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, thanks for the explanation
💚 Backport successful
|
) This fixes a bug in ILM where if an ILM policy is updated such that the next phase (e.g. warm) contains the downsample action from the previous phase (e.g. hot), whilst the managed index is waiting to enter the next phase (e.g. warm), if the managed index was already downsampled in hot it would get deleted in the warm phase. Fixes elastic#102249
…102251) This fixes a bug in ILM where if an ILM policy is updated such that the next phase (e.g. warm) contains the downsample action from the previous phase (e.g. hot), whilst the managed index is waiting to enter the next phase (e.g. warm), if the managed index was already downsampled in hot it would get deleted in the warm phase. Fixes #102249
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Thanks Andrei for fixing this!
This fixes a bug in ILM where if an ILM policy is updated such that the next phase (e.g. warm) contains the downsample action from the previous phase (e.g. hot), whilst the managed index is waiting to enter the next phase (e.g. warm), if the managed index was already downsampled in hot it would get deleted in the warm phase.
Fixes #102249