-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Fix ILM history index settings #61880
Conversation
Pinging @elastic/es-core-features (:Core/Features/ILM+SLM) |
//wait for all history items to index to avoid waiting for timeout in ILMHistoryStore beforeBulk | ||
Thread.sleep(6000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would beforeBulk
timeout? would removing the policy from the test
index and/or stopping ILM solve the issue of outstanding ilm-history entries? (we're manually rolling over the ilm-history
alias so ILM is only needed to trigger the creation of the first history index)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it, I stop ILM to reduce amount of history items to index and I wait for the ones that are created. It should be better than explicit wait. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this @probakowski
I think it's nearly done, just one more note on the test as I think it might yield some flakiness
//wait for all history items to index to avoid waiting for timeout in ILMHistoryStore beforeBulk | ||
assertBusy(() -> { | ||
SearchResponse search = client().prepareSearch(firstIndex).setQuery(matchQuery("index", firstIndex)).setSize(0).get(); | ||
assertThat(search.getHits().getTotalHits().value, greaterThan(0L)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we avoid the randomisation of the ILM policy and use an empty hot phase only ILM policy? that way we can assert exactly how many items must be inserted before moving on with the test tear down. I think there might be another race condition possible otherwise as the stop ILM call is not a hard stop but has to be detected and depending on what step we're in we might execute more steps (see https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java#L133 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be right there is still flakiness there. I've simplified policy, wait for exact number of messages to be indexed and wait for ILM to be stopped
@elasticmachine update branch |
There was a problem hiding this 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 Przemko
This change fixed settings accidentally changed in elastic#61457, this fixes ability of ILM history index to rollover. It also adds test to make sure we can't hit this kind of bug in the future. Closes elastic#61863
This change fixed settings accidentally changed in #61457, this fixes ability of ILM history index to rollover.
It also adds test to make sure we can't hit this kind of bug in the future.
Closes #61863