Skip to content

Conversation

@colings86
Copy link
Contributor

if policy update on index means current step no longer exists

This change only updates the setPolicy for index to add this
functionality. The update policy API will be changed in a follow up PR.

@colings86 colings86 added review :Data Management/ILM+SLM Index and Snapshot lifecycle management labels Jul 23, 2018
@colings86 colings86 self-assigned this Jul 23, 2018
@colings86 colings86 requested review from jasontedor and talevy July 23, 2018 13:53
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Contributor

Choose a reason for hiding this comment

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

should we find a way to do this so that either toSteps is derived from toStepKeys, or vice-versa? The separation of these in ways that need to be kept consistent sounds like it may be difficult to keep in sync

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I thought about this at the time but the problem is that in order to derive the steps from the step keys we would end up having some ugly if-else logic to iterate through the keys returned by toStepKeys and for each try to work out which step it is based on and build that step. The reverse of building the stepKeys based on the output of toSteps meant passing in a null client in production code which I also didn't like because it could potentially cause NPE's. In order to try to keep consistency between the two methods AbstractActionTestCase has a method which create a random instance of the action under test and makes sure that the step keys from the steps generated by toSteps() are the same as the step keys created by toStepKeys(): https://github.com/elastic/elasticsearch/pull/32283/files#diff-99c08c350d9cf07e3a5366ab534f80f7R28

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, then I guess that is the best we can do for now. I do not see a better way at the moment either

@talevy
Copy link
Contributor

talevy commented Jul 25, 2018

I think the CI failure is just because this needs latest merged in

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I follow why the step before a phase would be the terminal step?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, I think I get it. you are looking for the after-step for the next phase, but there is no next phase, so we go straight to terminalpolicystep. If this is the case, some extra docs would help make that clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you are correct, I'll try to clarify it better int eh comment

Copy link
Contributor

Choose a reason for hiding this comment

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

can we add javadocs to guide the comments in the branches?

@colings86
Copy link
Contributor Author

@talevy I added the comments and java docs you asked for. Could you look again?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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 with the NORELEASE follow-up in mind

if policy update on index means current step no longer exists

This change only updates the setPolicy for index to add this
functionality. The update policy API will be changed in a follow up PR.
@colings86 colings86 merged commit 783e427 into elastic:index-lifecycle Jul 27, 2018
@colings86 colings86 deleted the ilm/missingStepOnUpdate branch July 27, 2018 12:40
jasontedor pushed a commit that referenced this pull request Aug 17, 2018
if policy update on index means current step no longer exists

This change only updates the setPolicy for index to add this
functionality. The update policy API will be changed in a follow up PR.
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