[ML] Wait for shards to initialize after creating ML internal indices#59027
Merged
droberts195 merged 4 commits intoelastic:masterfrom Jul 6, 2020
Merged
Conversation
There have been a few test failures that are likely caused by tests performing actions that use ML indices immediately after the actions that create those ML indices. Currently this can result in attempts to search the newly created index before its shards have initialized. This change makes the method that creates the internal ML indices that have been affected by this problem (state and stats) wait for the shards to be initialized before returning. Fixes elastic#54887 Fixes elastic#55221 Fixes elastic#55807 Fixes elastic#57102 Fixes elastic#58841 Fixes elastic#59011
Collaborator
|
Pinging @elastic/ml-core (:ml) |
davidkyle
approved these changes
Jul 6, 2020
przemekwitek
approved these changes
Jul 6, 2020
przemekwitek
left a comment
There was a problem hiding this comment.
LGTM
Thanks for fixing this, just 2 minor comments.
| ActionListener.<ClusterHealthResponse>wrap( | ||
| response -> finalListener.onResponse(response.isTimedOut() == false), | ||
| finalListener::onFailure), | ||
| (request, listener) -> client.admin().cluster().health(request, listener) |
There was a problem hiding this comment.
I think you could replace this call with a more concise client.admin().cluster()::health.
| ActionListener<Boolean> finalListener) { | ||
|
|
||
| // If the index and alias were successfully created then wait for the shards of the index that the alias points to be ready | ||
| ActionListener<Boolean> waitForShardsListener = ActionListener.wrap( |
There was a problem hiding this comment.
TBH it is always unclear to me how should I name the listener variable: after the action that takes place inside the listener or after the action that invokes the listener in the end?
Is there any codebase-wide guideline for that?
Author
|
Jenkins run elasticsearch-ci/bwc |
Author
|
@elasticmachine update branch |
droberts195
added a commit
to droberts195/elasticsearch
that referenced
this pull request
Jul 6, 2020
There have been a few test failures that are likely caused by tests performing actions that use ML indices immediately after the actions that create those ML indices. Currently this can result in attempts to search the newly created index before its shards have initialized. This change makes the method that creates the internal ML indices that have been affected by this problem (state and stats) wait for the shards to be initialized before returning. Backport of elastic#59027
droberts195
added a commit
that referenced
this pull request
Jul 7, 2020
…#59087) There have been a few test failures that are likely caused by tests performing actions that use ML indices immediately after the actions that create those ML indices. Currently this can result in attempts to search the newly created index before its shards have initialized. This change makes the method that creates the internal ML indices that have been affected by this problem (state and stats) wait for the shards to be initialized before returning. Backport of #59027
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.
There have been a few test failures that are likely caused by tests
performing actions that use ML indices immediately after the actions
that create those ML indices. Currently this can result in attempts
to search the newly created index before its shards have initialized.
This change makes the method that creates the internal ML indices
that have been affected by this problem (state and stats) wait for
the shards to be initialized before returning.
Fixes #54887
Fixes #55221
Fixes #55807
Fixes #57102
Fixes #58841
Fixes #59011