-
Notifications
You must be signed in to change notification settings - Fork 25k
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] Fix logic for moving .ml-state-write alias from legacy to new #69039
Merged
droberts195
merged 6 commits into
elastic:master
from
droberts195:existence_checks_should_include_unavailable
Feb 19, 2021
Merged
[ML] Fix logic for moving .ml-state-write alias from legacy to new #69039
droberts195
merged 6 commits into
elastic:master
from
droberts195:existence_checks_should_include_unavailable
Feb 19, 2021
Conversation
This file contains 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
Generally we use the lenientExpandOpen indices options when searching our internal indices. However, there are places where we are not searching but checking existence, and in these places we should not be ignoring unavailable indices. Issue elastic#68925 reveals the sorts of things that can go wrong when decisions are made that should be based on existance of our internal indices but are instead based on current availability. Eventually the unavailable index will become available again, and this will cause problems if we created another index or alias on the assumption it did not exist at all. Fixes elastic#68925
Pinging @elastic/ml-core (Team:ML) |
przemekwitek
approved these changes
Feb 16, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
As well as switching off the "ignore unavailable" option it also switches to throwing an exception when non-wildcard indices don't exist.
droberts195
changed the title
[ML] Use strict expansion for internal index existence checks
[ML] Include closed indices for internal index existence checks
Feb 16, 2021
This reverts commit 4e5d90f.
The original approach was wrong. We _do_ want to ignore unavailable indices from the point of view of throwing exceptions, but we want to include closed indices.
droberts195
changed the title
[ML] Include closed indices for internal index existence checks
[ML] Fix logic for moving .ml-state-write alias from legacy to new
Feb 19, 2021
droberts195
added a commit
to droberts195/elasticsearch
that referenced
this pull request
Feb 19, 2021
When multiple jobs start up together on a node following an upgrade, each one of them will trigger a check that the .ml-state* indices are as expected and the .ml-state-write alias points to the correct index. There were a couple of flaws in the logic: 1. We were not considering the possibility that one or more existing .ml-state* indices might be hidden. 2. If multiple jobs tried to create a .ml-state-000001 index simultaneously all but the first would fail. We accounted for this, but then did not follow up with the correct alias update request for those index creation requests that failed. This could cause all but one of the jobs starting up on the node to spuriously fail. Both these problems are fixed by this PR. Backport of elastic#69039
droberts195
added a commit
to droberts195/elasticsearch
that referenced
this pull request
Feb 19, 2021
When multiple jobs start up together on a node following an upgrade, each one of them will trigger a check that the .ml-state* indices are as expected and the .ml-state-write alias points to the correct index. There were a couple of flaws in the logic: 1. We were not considering the possibility that one or more existing .ml-state* indices might be hidden. 2. If multiple jobs tried to create a .ml-state-000001 index simultaneously all but the first would fail. We accounted for this, but then did not follow up with the correct alias update request for those index creation requests that failed. This could cause all but one of the jobs starting up on the node to spuriously fail. Both these problems are fixed by this PR. Backport of elastic#69039
droberts195
added a commit
to droberts195/elasticsearch
that referenced
this pull request
Feb 19, 2021
When multiple jobs start up together on a node following an upgrade, each one of them will trigger a check that the .ml-state* indices are as expected and the .ml-state-write alias points to the correct index. There were a couple of flaws in the logic: 1. We were not considering the possibility that one or more existing .ml-state* indices might be hidden. 2. If multiple jobs tried to create a .ml-state-000001 index simultaneously all but the first would fail. We accounted for this, but then did not follow up with the correct alias update request for those index creation requests that failed. This could cause all but one of the jobs starting up on the node to spuriously fail. Both these problems are fixed by this PR. Backport of elastic#69039
droberts195
added a commit
that referenced
this pull request
Feb 19, 2021
…69279) When multiple jobs start up together on a node following an upgrade, each one of them will trigger a check that the .ml-state* indices are as expected and the .ml-state-write alias points to the correct index. There were a couple of flaws in the logic: 1. We were not considering the possibility that one or more existing .ml-state* indices might be hidden. 2. If multiple jobs tried to create a .ml-state-000001 index simultaneously all but the first would fail. We accounted for this, but then did not follow up with the correct alias update request for those index creation requests that failed. This could cause all but one of the jobs starting up on the node to spuriously fail. Both these problems are fixed by this PR. Backport of #69039
droberts195
added a commit
that referenced
this pull request
Feb 19, 2021
…69282) When multiple jobs start up together on a node following an upgrade, each one of them will trigger a check that the .ml-state* indices are as expected and the .ml-state-write alias points to the correct index. There were a couple of flaws in the logic: 1. We were not considering the possibility that one or more existing .ml-state* indices might be hidden. 2. If multiple jobs tried to create a .ml-state-000001 index simultaneously all but the first would fail. We accounted for this, but then did not follow up with the correct alias update request for those index creation requests that failed. This could cause all but one of the jobs starting up on the node to spuriously fail. Both these problems are fixed by this PR. Backport of #69039
droberts195
added a commit
that referenced
this pull request
Feb 19, 2021
…69280) When multiple jobs start up together on a node following an upgrade, each one of them will trigger a check that the .ml-state* indices are as expected and the .ml-state-write alias points to the correct index. There were a couple of flaws in the logic: 1. We were not considering the possibility that one or more existing .ml-state* indices might be hidden. 2. If multiple jobs tried to create a .ml-state-000001 index simultaneously all but the first would fail. We accounted for this, but then did not follow up with the correct alias update request for those index creation requests that failed. This could cause all but one of the jobs starting up on the node to spuriously fail. Both these problems are fixed by this PR. Backport of #69039
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.
When multiple jobs start up together on a node following
an upgrade, each one of them will trigger a check that the
.ml-state* indices are as expected and the .ml-state-write
alias points to the correct index.
There were a couple of flaws in the logic:
existing .ml-state* indices might be hidden.
simultaneously all but the first would fail. We accounted
for this, but then did not follow up with the correct alias
update request for those index creation requests that
failed. This could cause all but one of the jobs starting
up on the node to spuriously fail.
Both these problems are fixed by this PR.
Fixes #68925