-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Don't halt policy execution on policy trigger exception #49128
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When triggered either by becoming master, a new cluster state, or a periodic schedule, an ILM policy execution through `maybeRunAsyncAction`, `runPolicyAfterStateChange`, or `runPeriodicStep` throwing an exception will cause the loop the terminate. This means that any indices that would have been processed after the index where the exception was thrown will not be processed by ILM. For most execution this is not a problem because the actual running of steps is protected by a try/catch that moves the index to the ERROR step in the event of a problem. If an exception occurs prior to step execution (for example, in fetching and parsing the current policy/step) however, it causes the loop termination previously mentioned. This commit wraps the invocation of the methods specified above in a try/catch block that provides better logging and does not bubble the exception up.
dakrone
added
>bug
:Data Management/ILM+SLM
Index and Snapshot lifecycle management
v8.0.0
v7.5.0
v7.6.0
v7.4.3
labels
Nov 15, 2019
Pinging @elastic/es-core-features (:Core/Features/ILM+SLM) |
I re-opened #37581 (comment) for the failure (it is unrelated to this PR) @elasticmachine run elasticsearch-ci/1 |
andreidan
approved these changes
Nov 15, 2019
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 - great catch Lee!
dakrone
added a commit
to dakrone/elasticsearch
that referenced
this pull request
Nov 15, 2019
When triggered either by becoming master, a new cluster state, or a periodic schedule, an ILM policy execution through `maybeRunAsyncAction`, `runPolicyAfterStateChange`, or `runPeriodicStep` throwing an exception will cause the loop the terminate. This means that any indices that would have been processed after the index where the exception was thrown will not be processed by ILM. For most execution this is not a problem because the actual running of steps is protected by a try/catch that moves the index to the ERROR step in the event of a problem. If an exception occurs prior to step execution (for example, in fetching and parsing the current policy/step) however, it causes the loop termination previously mentioned. This commit wraps the invocation of the methods specified above in a try/catch block that provides better logging and does not bubble the exception up.
dakrone
added a commit
to dakrone/elasticsearch
that referenced
this pull request
Nov 15, 2019
When triggered either by becoming master, a new cluster state, or a periodic schedule, an ILM policy execution through `maybeRunAsyncAction`, `runPolicyAfterStateChange`, or `runPeriodicStep` throwing an exception will cause the loop the terminate. This means that any indices that would have been processed after the index where the exception was thrown will not be processed by ILM. For most execution this is not a problem because the actual running of steps is protected by a try/catch that moves the index to the ERROR step in the event of a problem. If an exception occurs prior to step execution (for example, in fetching and parsing the current policy/step) however, it causes the loop termination previously mentioned. This commit wraps the invocation of the methods specified above in a try/catch block that provides better logging and does not bubble the exception up.
dakrone
added a commit
to dakrone/elasticsearch
that referenced
this pull request
Nov 15, 2019
When triggered either by becoming master, a new cluster state, or a periodic schedule, an ILM policy execution through `maybeRunAsyncAction`, `runPolicyAfterStateChange`, or `runPeriodicStep` throwing an exception will cause the loop the terminate. This means that any indices that would have been processed after the index where the exception was thrown will not be processed by ILM. For most execution this is not a problem because the actual running of steps is protected by a try/catch that moves the index to the ERROR step in the event of a problem. If an exception occurs prior to step execution (for example, in fetching and parsing the current policy/step) however, it causes the loop termination previously mentioned. This commit wraps the invocation of the methods specified above in a try/catch block that provides better logging and does not bubble the exception up.
dakrone
added a commit
that referenced
this pull request
Nov 15, 2019
This commit wraps the calls to retrieve the current step in a try/catch so that the exception does not bubble up. Instead, step info is added containing the exception to the existing step. Semi-related to #49128
andreidan
pushed a commit
that referenced
this pull request
Nov 19, 2019
This commit wraps the calls to retrieve the current step in a try/catch so that the exception does not bubble up. Instead, step info is added containing the exception to the existing step. Semi-related to #49128
andreidan
pushed a commit
to andreidan/elasticsearch
that referenced
this pull request
Nov 19, 2019
This commit wraps the calls to retrieve the current step in a try/catch so that the exception does not bubble up. Instead, step info is added containing the exception to the existing step. Semi-related to elastic#49128 (cherry picked from commit 72530f8) Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
andreidan
pushed a commit
to andreidan/elasticsearch
that referenced
this pull request
Nov 19, 2019
This commit wraps the calls to retrieve the current step in a try/catch so that the exception does not bubble up. Instead, step info is added containing the exception to the existing step. Semi-related to elastic#49128 (cherry picked from commit 72530f8) Signed-off-by: Andrei Dan <andrei.dan@elastic.co>
This was referenced Feb 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>bug
:Data Management/ILM+SLM
Index and Snapshot lifecycle management
v7.4.3
v7.5.0
v7.6.0
v8.0.0-alpha1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When triggered either by becoming master, a new cluster state, or a
periodic schedule, an ILM policy execution through
maybeRunAsyncAction
,runPolicyAfterStateChange
, orrunPeriodicStep
throwing an exception will cause the loop theterminate. This means that any indices that would have been processed
after the index where the exception was thrown will not be processed by
ILM.
For most execution this is not a problem because the actual running of
steps is protected by a try/catch that moves the index to the ERROR step
in the event of a problem. If an exception occurs prior to step
execution (for example, in fetching and parsing the current
policy/step) however, it causes the loop termination previously
mentioned.
This commit wraps the invocation of the methods specified above in a
try/catch block that provides better logging and does not bubble the
exception up.