Adds checks to ensure index metadata exists when we try to use it#33455
Merged
colings86 merged 2 commits intoelastic:index-lifecyclefrom Sep 7, 2018
colings86:ilm/fix-no-index
Merged
Adds checks to ensure index metadata exists when we try to use it#33455colings86 merged 2 commits intoelastic:index-lifecyclefrom colings86:ilm/fix-no-index
colings86 merged 2 commits intoelastic:index-lifecyclefrom
colings86:ilm/fix-no-index
Conversation
Collaborator
|
Pinging @elastic/es-core-infra |
dakrone
approved these changes
Sep 6, 2018
Member
dakrone
left a comment
There was a problem hiding this comment.
LGTM, I left one optional comment. I've run into this issue a few times locally so it's good to fix it in as many places as possible
| } | ||
|
|
||
| private void runPolicy(IndexMetaData indexMetaData, ClusterState currentState) { | ||
| if (indexMetaData == null) { |
Member
There was a problem hiding this comment.
I think my preference would be to handle this in the caller of runPolicy, what do you think? (I'm okay either way)
Contributor
There was a problem hiding this comment.
moveToStep is the only caller of this method, so I am also more-or-less indifferent to where this goes
colings86
added a commit
that referenced
this pull request
Sep 7, 2018
AthenaEryma
added a commit
that referenced
this pull request
Oct 23, 2018
Adds a null check for IndexMetaData similar to those in #33455.
AthenaEryma
added a commit
that referenced
this pull request
Oct 23, 2018
Adds a null check for IndexMetaData similar to those in #33455.
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.
IF the index no longer exists when we try to retrieve the index metadata it's been delete since the policy was triggered and there is nothing for us to do. Currently in a few places we throw a NPE if this happens which, although it does not affect the execution result is ugly and logs a needless stack trace which suggests something might be wrong even though its not. This change makes sure we check for when this happens, logs a debug message and then ignores execution of that index for whatever operation is in progress.