move replicas action functionality into AllocateAction#32523
Merged
talevy merged 6 commits intoelastic:index-lifecyclefrom Aug 8, 2018
Merged
move replicas action functionality into AllocateAction#32523talevy merged 6 commits intoelastic:index-lifecyclefrom
talevy merged 6 commits intoelastic:index-lifecyclefrom
Conversation
Collaborator
|
Pinging @elastic/es-core-infra |
224243c to
1eeac50
Compare
1eeac50 to
fea1f5e
Compare
colings86
suggested changes
Aug 7, 2018
Contributor
colings86
left a comment
There was a problem hiding this comment.
I left a comment asking for an extra test but otherwise I think this is good
| assertThat(getStepKey(settings), equalTo(TerminalPolicyStep.KEY)); | ||
| assertThat(settings.get(IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey()), equalTo(String.valueOf(finalNumReplicas))); | ||
| }); | ||
| } |
Contributor
There was a problem hiding this comment.
Could we also add a test that tests the bug I found (so where we change both replicas and allocate at the same times on a configuration where the resulting nodes would not be enough to allocate the original number of replicas)?
Contributor
Author
|
@colings86 thanks for taking a look. I've added a unit test to check the allocation of an unallocated replica |
colings86
approved these changes
Aug 8, 2018
| AllocateAction other = (AllocateAction) obj; | ||
| return Objects.equals(include, other.include) && Objects.equals(exclude, other.exclude) && Objects.equals(require, other.require); | ||
| return Objects.equals(numberOfReplicas, other.numberOfReplicas) && Objects.equals(include, other.include) | ||
| && Objects.equals(exclude, other.exclude) && Objects.equals(require, other.require); |
Contributor
There was a problem hiding this comment.
nit: can we put each of these on its own line as it makes debugging much easier?
Contributor
Author
|
thanks! |
jasontedor
pushed a commit
that referenced
this pull request
Aug 17, 2018
Since replica counts and allocation rules are set separately, it is not always clear how many replicas are to be allocated in the allocate action. Moving the replicas action to occur at the same time as the allocate action, resolves this confusion that could end an undesired state. This means that the ReplicasAction is removed, and a new optional replicas parameter is added to AllocateAction.
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.
Since replica counts and allocation rules are set separately, it is not always clear how many replicas are to be allocated in the allocate action. Moving the replicas action to occur at the same time as the allocate action, resolves this confusion that could end an undesired state. This means that the ReplicasAction is removed, and a new optional replicas parameter is added to AllocateAction.