Avoid race condition in ILMHistorySotre#53039
Conversation
This change modifies ILMHistoryStore to always apply correct settings and mappings, even if template is deleted and not yet recreated. This ensures that ILM history index is correctly managed by ILM and also fixes flaky history tests that were prone to triggenring this race. This commit also refactors and simplifies ILM history tests. Closes elastic#50353 and elastic#52853
|
Pinging @elastic/es-core-features (:Core/Features/ILM+SLM) |
|
@elasticmachine run elasticsearch-ci/bwc |
|
@elasticmachine update branch |
andreidan
left a comment
There was a problem hiding this comment.
Thanks for fixing this @probakowski! LGTM
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStore.java
Outdated
Show resolved
Hide resolved
dakrone
left a comment
There was a problem hiding this comment.
This change looks good to be overall, but I think these tests will still end up failing due to the race condition between index creation via _bulk requests and manually being checked in the history store.
I think in order to fully fix them we need to add the settings to make the history store as non-async as possible when indexing, so we can prevent the alias/concrete-index issues that were causing failures in the past.
We can definitely merge this (thanks for doing this!), but I think we may still end up with some failures down the road.
|
Thanks @andreidan and @dakrone, I'll merge it as soon as build passes. |
|
@elasticmachine run elasticsearch-ci/bwc and run elasticsearch-ci/default-distro |
|
@elasticmachine update branch |
* Avoid race condition in ILMHistorySotre This change modifies ILMHistoryStore to always apply correct settings and mappings, even if template is deleted and not yet recreated. This ensures that ILM history index is correctly managed by ILM and also fixes flaky history tests that were prone to triggenring this race. This commit also refactors and simplifies ILM history tests. Closes elastic#50353 and elastic#52853 * Review comment Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Avoid race condition in ILMHistorySotre (#53039) * Avoid race condition in ILMHistorySotre This change modifies ILMHistoryStore to always apply correct settings and mappings, even if template is deleted and not yet recreated. This ensures that ILM history index is correctly managed by ILM and also fixes flaky history tests that were prone to triggenring this race. This commit also refactors and simplifies ILM history tests. Closes #50353 and #52853 * Review comment Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * fixed tests * backport #53306 Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This change modifies ILMHistoryStore to always apply correct settings and mappings,
even if template is deleted and not yet recreated. This ensures that ILM history index
is correctly managed by ILM and also fixes flaky history tests that were prone to
triggering this race.
This commit also refactors and simplifies ILM history tests.
Closes #50353 and #52853