Skip to content

Conversation

talevy
Copy link
Contributor

@talevy talevy commented May 21, 2018

This API adds the ability to re-run a policy for an index that encountered an error (moved to error step)

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

Pinging @elastic/es-core-infra

lifecycle: "my_lifecycle"

---
"Test Basic Re-run":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @colings86, do you have an idea of which real policy configuration can deterministically lead us into an error-step? This test will never pass since the steps-registry will not return the error unless it actually happened.

Copy link
Contributor

Choose a reason for hiding this comment

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

One way that I found accidentally is to configure a rollover action to rollover an alias that does not exist. I would expect that trying to shrink an index to a number of shards that it not a factor of the original number of shards would cause the error step too (e.g. try to shrink a 5 shard index to 2 shards).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, this scenario does work, but I cannot get the timing to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll skip this for now


public class ReRunAction extends Action<ReRunAction.Request, ReRunAction.Response, ReRunAction.RequestBuilder> {
public static final ReRunAction INSTANCE = new ReRunAction();
public static final String NAME = "cluster:admin/xpack/index_lifecycle/_rerun/post";
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 will want this to be an indices action rather than a cluster action. Also the request can then implement IndicesRequest so its API is consistent with how we do other requests that take an index on the url path

@talevy
Copy link
Contributor Author

talevy commented May 24, 2018

thanks for the initial review @colings86, I've updated to have more test coverage and updated to support multiple indices

@talevy talevy added review and removed WIP labels May 24, 2018
return new Response();
}

ClusterState innerExecute(ClusterState currentState, String[] indices) {
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 put this method in IndexLifecycleRunner to keep all the step transition logic in the same place?

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

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.

The change itself LGTM but I think we need a better name then rerun (I know I proposed that name to begin with). The problem I see it that rerun sounds like its an API to re-run the entire lifecycle for an index (especially when though of in the context of the URL pattern), so I think we need a name that is a bit more intuitive as to what the API actually does.

@talevy talevy changed the title add _rerun API to index lifecycle policies add _retry API to index lifecycle policies May 29, 2018
@talevy talevy removed the review label May 29, 2018
@talevy talevy merged commit 2f2832d into elastic:index-lifecycle May 30, 2018
@talevy talevy deleted the ilm-rerun branch May 30, 2018 02:16
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