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

[ML] Wait for all shards to be active when creating the ML stats index #108202

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

davidkyle
Copy link
Member

@davidkyle davidkyle commented May 2, 2024

Several tests have started failing recently with the dread no_shard_available_action_exception when querying the .ml-stats index. 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-stats index. 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-stats index is queried throwing the no_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-stats are 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-stats to initialise.

Closes #106652
Closes #107815
Closes #107777
Closes #107505
Closes #80703

@davidkyle davidkyle added >test Issues or PRs that are addressing/adding tests :ml Machine learning v8.14.0 v8.15.0 labels May 2, 2024
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label May 2, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@davidkyle davidkyle changed the title Wait for all shards to be active when creating the ML stats index [ML] Wait for all shards to be active when creating the ML stats index May 2, 2024
@przemekwitek przemekwitek self-requested a review May 6, 2024 13:32
Copy link
Contributor

@przemekwitek przemekwitek left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment