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

Fix ILM history index settings #61880

Merged
merged 4 commits into from
Sep 3, 2020

Conversation

probakowski
Copy link
Contributor

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

@probakowski probakowski added >bug :Data Management/ILM+SLM Index and Snapshot lifecycle management v8.0.0 labels Sep 2, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/ILM+SLM)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Sep 2, 2020
Comment on lines 89 to 90
//wait for all history items to index to avoid waiting for timeout in ILMHistoryStore beforeBulk
Thread.sleep(6000);
Copy link
Contributor

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)

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'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?

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 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));
Copy link
Contributor

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 )

Copy link
Contributor Author

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

@probakowski
Copy link
Contributor Author

@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 Przemko

@probakowski probakowski merged commit 969fa53 into elastic:master Sep 3, 2020
@probakowski probakowski deleted the ilm-history-settings branch September 3, 2020 18:49
probakowski added a commit to probakowski/elasticsearch that referenced this pull request Sep 3, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/ILM+SLM Index and Snapshot lifecycle management Team:Data Management Meta label for data/management team v7.10.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ILM history rollover missing alias
4 participants