Skip to content

Conversation

@talevy
Copy link
Contributor

@talevy talevy commented Aug 30, 2018

Since policies can be updated independent of execution plans for the current
phase being executed, it would be nice to know what the phase that is executing
looks like in JSON. This PR does just that, while also using that index setting
to reconstruct the phase steps to execute (for consistency)

There may or may not be a few unit tests missing to verify the json itself, let me know what you think. I figure the serialization is sufficient. Also, the expectation is that these will move from settings to IndexMetaData.Custom as a next step

@talevy talevy added WIP :Data Management/ILM+SLM Index and Snapshot lifecycle management labels Aug 30, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@talevy talevy force-pushed the ilm-remember-phase branch 2 times, most recently from 95fe928 to 21252c6 Compare August 31, 2018 00:43
Since policies can be updated independent of execution plans for the current
phase being executed, it would be nice to know what the phase that is executing
looks like in JSON. This PR does just that, while also using that index setting
to recontruct the phase steps to execute (for consistency)
@talevy talevy force-pushed the ilm-remember-phase branch from 21252c6 to 485be0c Compare August 31, 2018 00:57
@talevy talevy requested review from colings86 and dakrone August 31, 2018 00:57
@talevy talevy removed the WIP label Aug 31, 2018
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.

@talevy I left a comment but I think this is mostly good

if (phase != null) {
phaseMap.put(currentPhase, phase);
}
policyToExecute = new LifecyclePolicy(currentPolicy.getType(), currentPolicy.getName(), phaseMap);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to create a fake policy here with only 1 phase in it?

Copy link
Contributor Author

@talevy talevy Aug 31, 2018

Choose a reason for hiding this comment

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

the last step in the phase needs a correct nextstep, no? thinking this, and for the reason that step compilation only happens on the policy level, I thought it would be clear to just swap out the potential new version of the phase (or lack thereof) with the phase defined in settings.

I do think things in step compilation can be cleaned up to make this less wasteful and cleaner, but I thought it was reasonable

Copy link
Contributor

Choose a reason for hiding this comment

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

@talevy and I spoke about this and although this will want to change at some point we can't change to compile directly from the phase right now whilst the PhaseAfterStep still exists (which is being removed in a different task).

if (phase != null) {
phaseMap.put(currentPhase, phase);
}
policyToExecute = new LifecyclePolicy(currentPolicy.getType(), currentPolicy.getName(), phaseMap);
Copy link
Contributor

Choose a reason for hiding this comment

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

@talevy and I spoke about this and although this will want to change at some point we can't change to compile directly from the phase right now whilst the PhaseAfterStep still exists (which is being removed in a different task).

@talevy talevy merged commit 0f8bc10 into elastic:index-lifecycle Sep 5, 2018
@talevy talevy deleted the ilm-remember-phase branch September 5, 2018 18:35
@talevy
Copy link
Contributor Author

talevy commented Sep 5, 2018

thanks for the review @colings86, took a bit for CI to pass

talevy added a commit that referenced this pull request Sep 5, 2018
…#33289)

Since policies can be updated independent of execution plans for the current
phase being executed, it would be nice to know what the phase that is executing
looks like in JSON. This PR does just that, while also using that index setting
to recontruct the phase steps to execute (for consistency)
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.

3 participants