Skip to content
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

Replace PhaseAfterStep with PhaseCompleteStep #33398

Merged

Conversation

dakrone
Copy link
Member

@dakrone dakrone commented Sep 4, 2018

This removes PhaseAfterStep in favor of a new PhaseCompleteStep. This step
in only a marker that the LifecyclePolicyRunner needs to halt until the time
indicated for entering the next phase.

This also fixes a bug where phase times were encapsulated into the policy
instead of dynamically adjusting to policy changes.

Supersedes #33140, which it replaces
Relates to #29823

This removes `PhaseAfterStep` in favor of a new `PhaseCompleteStep`. This step
in only a marker that the `LifecyclePolicyRunner` needs to halt until the time
indicated for entering the next phase.

This also fixes a bug where phase times were encapsulated into the policy
instead of dynamically adjusting to policy changes.

Supersedes elastic#33140, which it replaces
@dakrone dakrone added the :Data Management/ILM+SLM Index and Snapshot lifecycle management label Sep 4, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Contributor

@talevy talevy left a comment

Choose a reason for hiding this comment

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

looks great! just left some q&c

- match: { indices.foo.index: "foo" }
- match: { indices.foo.policy: "quick_warm_slow_cold" }
- match: { indices.foo.phase: "warm" }
- match: { indices.foo.action: "readonly" }
Copy link
Contributor

Choose a reason for hiding this comment

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

are there no potential timing issues here? Is the reason that this is relatively consistent because
the next time it'll proceed is from a scheduled poll, and that won't happen for another while?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, there are timing issues here, I'm going to remove this test

@dakrone
Copy link
Member Author

dakrone commented Sep 4, 2018

Thanks for the comments @talevy, I believe I addressed all your feedback

Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

@dakrone I left a comment about the next step of the phase complete step, otherwise I think this change is good

public static final String NAME = "complete";

public PhaseCompleteStep(StepKey key, StepKey nextStepKey) {
super(key, nextStepKey);
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 we need to make the next step key always null in these steps? The reason is that the next step after this phase could change before we get there. I think we need to determine the next phase dynamically when we find ourselves at a PhaseCompleteStep and have each phase separated from each other in the steps chain. I think this might mean having something like a MoveToPhaseUpdateTask so these checks happen on the cluster state update thread where we know the cluster state is static and we can inspect the policy.

I am ok with this happening as a follow up PR though so this PR is kept more contained.

Copy link
Member Author

@dakrone dakrone Sep 5, 2018

Choose a reason for hiding this comment

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

I agree with the eventual plan, and I do think this should be a follow up to this PR, especially with @talevy's #33289 which changes how we compute phase steps

@dakrone
Copy link
Member Author

dakrone commented Sep 5, 2018

@elasticmachine test this please

Copy link
Contributor

@talevy talevy left a comment

Choose a reason for hiding this comment

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

LGTM

@dakrone dakrone merged commit 96d515e into elastic:index-lifecycle Sep 5, 2018
dakrone added a commit that referenced this pull request Sep 6, 2018
This removes `PhaseAfterStep` in favor of a new `PhaseCompleteStep`. This step
in only a marker that the `LifecyclePolicyRunner` needs to halt until the time
indicated for entering the next phase.

This also fixes a bug where phase times were encapsulated into the policy
instead of dynamically adjusting to policy changes.

Supersedes #33140, which it replaces
Relates to #29823
@dakrone dakrone deleted the ilm-adjust-phase-after-step branch February 4, 2019 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants