-
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
Stop policy on last PhaseCompleteStep instead of TerminalPolic… #51631
Conversation
Currently when an ILM policy finishes its execution, the index moves into the `TerminalPolicyStep`, denoted by a completed/completed/completed phase/action/step lifecycle execution state. This commit changes the behavior so that the index lifecycle execution state halts at the last configured phase's `PhaseCompleteStep`, so for instance, if an index were configured with a policy containing a `hot` and `cold` phase, the index would stop at the `cold/complete/complete` `PhaseCompleteStep`. This allows an ILM user to update the policy to add any later phases and have indices configured to use that policy pick up execution at the newly added "later" phase. For example, if a `delete` phase were added to the policy specified about, the index would then move from `cold/complete/complete` into the `delete` phase. Relates to elastic#48431
Pinging @elastic/es-core-features (:Core/Features/ILM+SLM) |
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.
Thanks for working on this @dakrone This looks great overall, I left a few questions but I think this is mostly ready
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/ExecuteStepsUpdateTask.java
Show resolved
Hide resolved
...ugin/ilm/qa/multi-cluster/src/test/java/org/elasticsearch/xpack/ilm/CCRIndexLifecycleIT.java
Show resolved
Hide resolved
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleTransition.java
Show resolved
Hide resolved
}); | ||
} | ||
|
||
public void testMasterFailover() throws Exception { |
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.
was the deletion of this test intentional? if so shall we do it in a different commit so we have some semantics as to why it was removed?
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.
This was a test that didn't really do much outside of what we already have tested elsewhere, in addition, it was using a fake step that was near impossible to make work with the way that phases now operate, so I removed it.
I don't think a separate commit is that useful, since this ends up squashed into a single commit anyway?
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.
Ah, yeah, you're right (not sure how should we signal the reasoning behind these changes for future reference - commit message?)
LGTM, thanks @dakrone! |
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 @dakrone
…tic#51631) Currently when an ILM policy finishes its execution, the index moves into the `TerminalPolicyStep`, denoted by a completed/completed/completed phase/action/step lifecycle execution state. This commit changes the behavior so that the index lifecycle execution state halts at the last configured phase's `PhaseCompleteStep`, so for instance, if an index were configured with a policy containing a `hot` and `cold` phase, the index would stop at the `cold/complete/complete` `PhaseCompleteStep`. This allows an ILM user to update the policy to add any later phases and have indices configured to use that policy pick up execution at the newly added "later" phase. For example, if a `delete` phase were added to the policy specified about, the index would then move from `cold/complete/complete` into the `delete` phase. Relates to elastic#48431
Prior to the change in elastic#51631 indices were moved to the `TerminalPolicyStep` when their ILM actions had completed. Once we switched ILM to stop in the last policy configured, these steps because inaccessible from the policy's perspective. This meant that indices upgraded from ES prior to 7.7.0 could see the following error spammed in their logs every 10 minutes (by default) for every index in this state: ``` [2020-04-14T15:52:23,764][ERROR][o.e.x.i.IndexLifecycleRunner] [midgar] current step [{"phase":"completed","action":"completed","name":"completed"}] for index [foo] with policy [full] is not recognized ``` This changes the runner to ignore these steps, which is what is desired anyway since the index is already in the terminal phase.
Prior to the change in #51631 indices were moved to the `TerminalPolicyStep` when their ILM actions had completed. Once we switched ILM to stop in the last policy configured, these steps because inaccessible from the policy's perspective. This meant that indices upgraded from ES prior to 7.7.0 could see the following error spammed in their logs every 10 minutes (by default) for every index in this state: ``` [2020-04-14T15:52:23,764][ERROR][o.e.x.i.IndexLifecycleRunner] [midgar] current step [{"phase":"completed","action":"completed","name":"completed"}] for index [foo] with policy [full] is not recognized ``` This changes the runner to ignore these steps, which is what is desired anyway since the index is already in the terminal phase.
Prior to the change in #51631 indices were moved to the `TerminalPolicyStep` when their ILM actions had completed. Once we switched ILM to stop in the last policy configured, these steps because inaccessible from the policy's perspective. This meant that indices upgraded from ES prior to 7.7.0 could see the following error spammed in their logs every 10 minutes (by default) for every index in this state: ``` [2020-04-14T15:52:23,764][ERROR][o.e.x.i.IndexLifecycleRunner] [midgar] current step [{"phase":"completed","action":"completed","name":"completed"}] for index [foo] with policy [full] is not recognized ``` This changes the runner to ignore these steps, which is what is desired anyway since the index is already in the terminal phase.
Prior to the change in #51631 indices were moved to the `TerminalPolicyStep` when their ILM actions had completed. Once we switched ILM to stop in the last policy configured, these steps because inaccessible from the policy's perspective. This meant that indices upgraded from ES prior to 7.7.0 could see the following error spammed in their logs every 10 minutes (by default) for every index in this state: ``` [2020-04-14T15:52:23,764][ERROR][o.e.x.i.IndexLifecycleRunner] [midgar] current step [{"phase":"completed","action":"completed","name":"completed"}] for index [foo] with policy [full] is not recognized ``` This changes the runner to ignore these steps, which is what is desired anyway since the index is already in the terminal phase.
Currently when an ILM policy finishes its execution, the index moves into the
TerminalPolicyStep
,denoted by a completed/completed/completed phase/action/step lifecycle execution state.
This commit changes the behavior so that the index lifecycle execution state halts at the last
configured phase's
PhaseCompleteStep
, so for instance, if an index were configured with a policycontaining a
hot
andcold
phase, the index would stop at thecold/complete/complete
PhaseCompleteStep
. This allows an ILM user to update the policy to add any later phases and haveindices configured to use that policy pick up execution at the newly added "later" phase. For
example, if a
delete
phase were added to the policy specified about, the index would then movefrom
cold/complete/complete
into thedelete
phase.Relates to #48431