[ML] Wait for all shards to be active when creating the ML stats index#108202
Merged
maxhniebergall merged 9 commits intoelastic:mainfrom Oct 30, 2024
Merged
[ML] Wait for all shards to be active when creating the ML stats index#108202maxhniebergall merged 9 commits intoelastic:mainfrom
maxhniebergall merged 9 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/ml-core (Team:ML) |
prwhelan
requested changes
May 24, 2024
...n/core/src/test/java/org/elasticsearch/xpack/core/ml/integration/MlRestTestStateCleaner.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Pat Whelan <pat.whelan@elastic.co>
…idkyle/do-not-write-stats # Conflicts: # x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAliasTests.java # x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/inference_crud.yml # x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/ml/inference_processor.yml
…idkyle/do-not-write-stats
Contributor
|
This fix seemed super close to being done, so I just merged main into it and added Pat's change. I was able to reproduce the test failures before this change, and not after, so everything LGTM |
Contributor
|
@elasticmachine merge upstream |
prwhelan
approved these changes
Oct 30, 2024
davidkyle
added a commit
to davidkyle/elasticsearch
that referenced
this pull request
Oct 30, 2024
elastic#108202) * Wait for all shards to be active when creating the ML stats index * Unmute tests * Wait for the stats index in cleanup * more waiting for the stats index * Add adminclient to ensureHealth Co-authored-by: Pat Whelan <pat.whelan@elastic.co> * fix errors causing build failures --------- Co-authored-by: Max Hniebergall <137079448+maxhniebergall@users.noreply.github.com> Co-authored-by: Pat Whelan <pat.whelan@elastic.co> Co-authored-by: Max Hniebergall <max.hniebergall@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Collaborator
💚 Backport successful
|
jfreden
pushed a commit
to jfreden/elasticsearch
that referenced
this pull request
Nov 4, 2024
elastic#108202) * Wait for all shards to be active when creating the ML stats index * Unmute tests * Wait for the stats index in cleanup * more waiting for the stats index * Add adminclient to ensureHealth Co-authored-by: Pat Whelan <pat.whelan@elastic.co> * fix errors causing build failures --------- Co-authored-by: Max Hniebergall <137079448+maxhniebergall@users.noreply.github.com> Co-authored-by: Pat Whelan <pat.whelan@elastic.co> Co-authored-by: Max Hniebergall <max.hniebergall@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several tests have started failing recently with the dread
no_shard_available_action_exceptionwhen querying the.ml-statsindex. The error occurs when an index is accessed directly after creation before any shards have become active. See #65846 for more details.The recent failures stem from the change to invalidate the model cache in #106988. The cache is invalidated on PUT model which causes the models to be evicted and on eviction they persists stats to the
.ml-statsindex. The failing tests create a model causing the cache eviction and triggering a write to.ml-stats, immediately after the test clean up kicks in and during the model deletion the.ml-statsindex is queried throwing theno_shard_available_action_exception.The first part to wait for all shard to become active when creating the index but that isn't sufficient in itself as the writes to
.ml-statsare async. Creating or deleting a model kicks off the write but it may not have completed so the post test clean up needs to wait for the.ml-statsto initialise.Closes #106652
Closes #107815
Closes #107777
Closes #107505
Closes #80703