Skip to content

Replace PhaseAfterStep with PhaseCompleteStep#33398

Merged
dakrone merged 8 commits intoelastic:index-lifecyclefrom
dakrone:ilm-adjust-phase-after-step
Sep 5, 2018
Merged

Replace PhaseAfterStep with PhaseCompleteStep#33398
dakrone merged 8 commits intoelastic:index-lifecyclefrom
dakrone:ilm-adjust-phase-after-step

Conversation

@dakrone
Copy link
Copy Markdown
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 DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead. label Sep 4, 2018
@dakrone dakrone requested review from colings86 and talevy September 4, 2018 20:38
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

dakrone commented Sep 4, 2018

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

dakrone commented Sep 5, 2018

@elasticmachine test this please

Copy link
Copy Markdown
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 DO NOT USE. Use ":StorageEngine/ILM" or ":Distributed Coordination/SLM" instead.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants