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

Update ILM message for out of order phases error #75099

Merged
merged 10 commits into from
Jul 13, 2021

Conversation

Esduard
Copy link
Contributor

@Esduard Esduard commented Jul 8, 2021

Closes #70336. This new message is much more readable. One small inconvenience is that the frozen and delete phases are not metioned even though they are present in the tests. I mentioned only hot, warm and cold because they are the main page names for the "Hot-warm-cold" architecture.

@elasticsearchmachine elasticsearchmachine added v8.0.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Jul 8, 2021
@jakelandis jakelandis added the :Data Management/ILM+SLM Index and Snapshot lifecycle management label Jul 8, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Jul 8, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@jakelandis
Copy link
Contributor

@elasticmachine ok to test

@Esduard
Copy link
Contributor Author

Esduard commented Jul 8, 2021

I just realized I forgot to change a test in "org.elasticsearch.xpack.ilm.IndexLifecycleRestIT.test". Will correct it soon...

@Esduard
Copy link
Contributor Author

Esduard commented Jul 8, 2021

@cjcenizal I am having a bit of trouble making the test case for the yml file x-pack/plugin/ilm/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/ilm/10_basic.yml line 284

To be honest i have no idea how to write yml test files. Would you help me out by giving a few hints or links?

I am trying to write the correct catch element but i am not able to do so. Right now the statement looks like this:

catch: /Your policy is configured to run the delete phase (min_age\:\ 5s) before the warm phase (min_age\:\ 10s). You should change the phase timing so that the phases will execute in the order of hot, warm then cold./

@danhermann
Copy link
Contributor

@elasticmachine update branch

@danhermann
Copy link
Contributor

@Esduard, you were close. That line needs to be:

catch: /Your policy is configured to run the delete phase \(min_age\:\ 5s\) before the warm phase \(min_age\:\ 10s\). You should change the phase timing so that the phases will execute in the order of hot, warm then cold./

It's a regex expression so the parentheses also need to be escaped.

@danhermann
Copy link
Contributor

@elasticmachine ok to test

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

This is so awesome! Thanks for working on this @Esduard!

" [min_age] of [1d] for the [hot] phase, configuration: {cold=12h}"));
containsString("Your policy is configured to run the cold phase "+
"(min_age: 12h) before the hot phase (min_age: 1d). You should change "+
"the phase timing so that the phases will execute in the order of hot, warm then cold."));
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit: Can we add another comma after warm?

hot, warm, then cold

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course. It's a simple replace

@Esduard
Copy link
Contributor Author

Esduard commented Jul 8, 2021

Thanks @danhermann and @cjcenizal for the feedback! I managed to update the test with the correct regex. I also put the comma at the end of the error message.

@danhermann
Copy link
Contributor

@elasticmachine update branch

@Esduard
Copy link
Contributor Author

Esduard commented Jul 9, 2021

@danhermann I'm puzzled by this new error. Is it happening because the test executes code from another branch?

@danhermann
Copy link
Contributor

@danhermann I'm puzzled by this new error. Is it happening because the test executes code from another branch?

Close, it's running with some nodes that are from a previous version. You'll need to temporarily disable that test by adding:

tasks.named("yamlRestCompatTest").configure {
  systemProperty 'tests.rest.blacklist', [
    //TODO: remove once #75099 is back ported to 7.x
    'ilm/10_basic/Test increasing phase timings validated'
  ].join(',')
}

to the bottom of the x-pack/plugin/ilm/qa/rest/build.gradle file.

@danhermann
Copy link
Contributor

@elasticmachine update branch

Copy link
Contributor

@danhermann danhermann left a comment

Choose a reason for hiding this comment

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

@Esduard, this change looks pretty good. One thing I would suggest is a test case that has 3 or more phases with bad ages since it appears that all the current test cases have only 0, 1, or 2 phases with bad ages and there's different handling for the error message in the case of 3+.

@Esduard
Copy link
Contributor Author

Esduard commented Jul 13, 2021

@danhermann, that is a good idea. I will add this case test with 3+ bad ages as soon as I can.

@Esduard
Copy link
Contributor Author

Esduard commented Jul 13, 2021

@danhermann I decided to add 2 test cases: One for 3 bad phases and another for 4. That way we have test cases for every possible ammount of bad phases. Maybe Its overkill. Feel free to remove one If you like.

@danhermann danhermann changed the title update message for out of order page error Update ILM message for out of order phases error Jul 13, 2021
@danhermann
Copy link
Contributor

Thanks, @Esduard! This looks good. I'll get it merged and backported to the appropriate branches.

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 external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Data Management Meta label for data/management team v7.15.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve human-readability of ILM timing error message
6 participants