Skip to content
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

Expose the index age in ILM explain output. #81273

Merged
merged 13 commits into from Dec 13, 2021

Conversation

gmarouli
Copy link
Contributor

@gmarouli gmarouli commented Dec 2, 2021

ILM already exposes the age that ILM will use to transition to the next phase, based on that phase's min_age. The index_age is based only on the index creation date and it's used to trigger a rollover.

Resolves #64429

 ILM already exposes the `age` that ILM will use to transition to the next phase, based on that phase's `min_age`. The `index_age` is based only on the index creation date and it's used to trigger a rollover.

 Resolves elastic#64429
@andreidan andreidan added :Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement labels Dec 3, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Dec 3, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@gmarouli
Copy link
Contributor Author

gmarouli commented Dec 3, 2021

@elasticmachine run elasticsearch-ci/part-2

@gmarouli
Copy link
Contributor Author

gmarouli commented Dec 3, 2021

@elasticmachine update branch

@gmarouli
Copy link
Contributor Author

gmarouli commented Dec 6, 2021

@elasticmachine update branch

Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

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

Thanks for working on this Mary.

I think this generally looks good, I've left a few comments.

Comment on lines 114 to 115
"index_creation_date_millis": 1538475653281,
"index_age": "15s", <1>
Copy link
Contributor

Choose a reason for hiding this comment

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

@jrodewig @dakrone what do you think about the naming of these fields? We'll document they will be used by rollover in the age math for conditions, whilst the existing age for phase transition timings.

Do you think this is clear enough?

Copy link
Contributor

@jrodewig jrodewig Dec 8, 2021

Choose a reason for hiding this comment

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

Tagging @debadair, who has more ILM experience and can probably give better feedback. :)

Instead of index_age, I'd go with something a little more descriptive like time_since_index_creation or time_since_creation. That avoids conflation with age and min_age.

Ideally, we would change age to a more descriptive key too, but that would require a breaking change.

Copy link
Member

Choose a reason for hiding this comment

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

I agree that I think index_age is a little confusing, perhaps something like creation_age, or lifetime would be my suggestions.

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 do like that name, it does feel a bit weird that it is not inline with the other age though. Is there any convention we use for such fields in our APIs?

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 I could justify a breaking change to the age key name assuming

  1. there are not any known consumers of this API (other then humans )
  2. it can help make a meaningful difference how we express timings.

For example, if makes sense to keep index_age here but change age to phase_age in 8.0.0 I think that should be on the table too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the ideas, I will bring these options to the team and come back with a proposal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our proposal is:

  • age remains the same because it's already used by kibana so breaking backwards compatibility is not as painless.
  • time_since_index_creation will be the name of the new exposed field to make it as clear as possible and we intentionally want to avoid the word age so the two will not be easier distinguishable.

Thank you all for helping out :).

@gmarouli
Copy link
Contributor Author

gmarouli commented Dec 9, 2021

@elasticmachine update branch

Copy link
Contributor

@andreidan andreidan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for iterating on this @gmarouli

This makes the ages math a lot clearer.

I've left 2 minor suggestions.

"policy": "my_policy", <2>
"lifecycle_date_millis": 1538475653281, <3>
"age": "15s", <4>
"index_creation_date_millis": 1538475653281,
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we document this as well?

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, documentation added

@gmarouli gmarouli merged commit 175c479 into elastic:master Dec 13, 2021
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 >enhancement Team:Data Management Meta label for data/management team v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ILM: Report the index age used by the phase transition timings and the one used by the rollover action
7 participants