Implement canRemain for the IndexBalanceAllocationDecider#141494
Implement canRemain for the IndexBalanceAllocationDecider#141494nicktindall merged 12 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/es-distributed (Team:Distributed) |
| bestDecision = Type.NOT_PREFERRED; | ||
| if (allocationDecision.type().compareToBetweenDecisions(bestDecision) > 0) { | ||
| bestDecision = Type.NOT_PREFERRED; | ||
| } |
There was a problem hiding this comment.
This seems to break when we run decideMove with debug turned on. It will find a YES and then it'll find a NOT_PREFERRED and over-write the bestDecision=YES with NOT_PREFERRED.
This trips an assertion later that checks that canAllocate=NOT_PREFERRED and canRemain=NOT_PREFERRED comes with no targetNode
Happy to break this out as a separate bugfix PR? it doesn't seem to be biting us at the moment.
There was a problem hiding this comment.
Yeah let's break it into a separate bug-fix PR.
There was a problem hiding this comment.
Please make sure the merge conflict is resolved here.
ywangd
left a comment
There was a problem hiding this comment.
I have some minor comments on mostly the existing code.
| bestDecision = Type.NOT_PREFERRED; | ||
| if (allocationDecision.type().compareToBetweenDecisions(bestDecision) > 0) { | ||
| bestDecision = Type.NOT_PREFERRED; | ||
| } |
There was a problem hiding this comment.
Yeah let's break it into a separate bug-fix PR.
...java/org/elasticsearch/cluster/routing/allocation/decider/IndexBalanceAllocationDecider.java
Outdated
Show resolved
Hide resolved
...java/org/elasticsearch/cluster/routing/allocation/decider/IndexBalanceAllocationDecider.java
Outdated
Show resolved
Hide resolved
...java/org/elasticsearch/cluster/routing/allocation/decider/IndexBalanceAllocationDecider.java
Outdated
Show resolved
Hide resolved
| bestDecision = Type.NOT_PREFERRED; | ||
| if (allocationDecision.type().compareToBetweenDecisions(bestDecision) > 0) { | ||
| bestDecision = Type.NOT_PREFERRED; | ||
| } |
There was a problem hiding this comment.
Please make sure the merge conflict is resolved here.
# Conflicts: # server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java
…e_decider' into implement_canRemain_index_balance_decider
When the size of the cluster increases, the ideal spread of shards may change, meaning it might improve index balance if we move some shards to the new nodes.
This change adds
canRemainsupport to theIndexBalanceAllocationDecider, so when arerouteis performed in response to a new node joining the cluster, the allocator will make any necessary moves to maintain index balance.There is an integration test in a linked serverless PR
Relates: ES-13566