Skip to content

add notion of version and creation_date to LifecyclePolicyMetadata #33450

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

Merged
merged 3 commits into from
Sep 6, 2018

Conversation

talevy
Copy link
Contributor

@talevy talevy commented Sep 6, 2018

It is useful to keep track of which version of a policy is currently
being executed by a specific index. For management purposes, it would
also be useful to know at which time the latest version was inserted
so that an audit trail is left for reconciling changes happening in ILM.

The work here only adds a notion of version and creation_date to the lifecycle-metadata. The index settings are not updated with which version their currently executed phase_definition is because these settings are to be moved to custom indexmetadata anyways, and I would prefer to minimize conflicts here, happy to do this in a follow-up if the time is right.

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

Pinging @elastic/es-core-infra

@talevy talevy force-pushed the ilm-version branch 3 times, most recently from ce3a034 to 0b0bba4 Compare September 6, 2018 00:17
It is useful to keep track of which version of a policy is currently
being executed by a specific index. For management purposes, it would
also be useful to know at which time the latest version was inserted
so that an audit trail is left for reconciling changes happening in ILM.
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, I think we need to have a proper class int he response rather than trying to use Maps and Tuples

@@ -37,42 +38,49 @@ public Response newResponse() {

public static class Response extends ActionResponse implements ToXContentObject {

private List<LifecyclePolicy> policies;
private Map<LifecyclePolicy, Tuple<Long, String>> policiesToMetadata;
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 should make this nicer here. Having a map is not nice because the key is not something you are realistically going to to use to lookup things and Tuples are generally not particularly nice to consume. Can we create a wrapper class around the policy, date and version so we have an object that is easier to consume both for us internally and for users of the transport API (given this class will be exposed to the Transport API)?

@talevy
Copy link
Contributor Author

talevy commented Sep 6, 2018

thanks @colings86, I've updated to use a proper class

@talevy talevy requested a review from colings86 September 6, 2018 17:02
for (LifecyclePolicyMetadata policyMetadata : requestedPolicies) {
responseItems.add(new LifecyclePolicyResponseItem(policyMetadata.getPolicy(),
policyMetadata.getVersion(), policyMetadata.getCreationDateString()));
}
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 not create the list of LifecyclePolicyResponseItem directly rather than first creating the list of LifecyclePolicyMetadata?

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.

LGTM if the comment I left is solved

@talevy talevy merged commit 21bb472 into elastic:index-lifecycle Sep 6, 2018
@talevy talevy deleted the ilm-version branch September 6, 2018 20:32
talevy added a commit that referenced this pull request Sep 6, 2018
…33450)

It is useful to keep track of which version of a policy is currently
being executed by a specific index. For management purposes, it would
also be useful to know at which time the latest version was inserted
so that an audit trail is left for reconciling changes happening in ILM.
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