-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Start the allocation architecture guide section #121940
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
Start the allocation architecture guide section #121940
Conversation
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
DaveCTurner
left a comment
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.
Looks good, just a few small comments.
| The `DesiredBalanceShardsAllocator` is what runs shard allocation decisions. It leverages the `DesiredBalanceComputer` to produce | ||
| `DesiredBalance` instances for the cluster based on the latest cluster changes (add/remove nodes, create/remove indices, load, etc). Then | ||
| the `DesiredBalanceReconciler` is invoked to choose the next steps to take to move the cluster from the current shard allocation to the | ||
| latest computed `DesiredBalance` shard allocation. The `Reconciler` will apply changes to a copy of the `RoutingNodes`, which is then |
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.
nit: DesiredBalanceReconciler not just Reconciler (here and below)
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.
Done
| Asynchronous completion of a new `DesiredBalance` will also invoke a reconciliation action, as will cluster state updates completing shard | ||
| moves/recoveries (unthrottling the next shard move/recovery). | ||
|
|
||
| The `ContinuousComputation` maintains a queue of desired balance computation requests, each of which holds the latest cluster information at |
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.
Kind of a queue but really it's only tracking the latest request.
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.
Fixed, thanks for catching that.
I guess the enqueued terminology got stuck in my head :)
| moves/recoveries (unthrottling the next shard move/recovery). | ||
|
|
||
| The `ContinuousComputation` maintains a queue of desired balance computation requests, each of which holds the latest cluster information at | ||
| the time of the request, and a thread that runs the `DesiredBalanceComputer`. The ContinuousComputation thread grabs the latest request, |
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.
nit:
| the time of the request, and a thread that runs the `DesiredBalanceComputer`. The ContinuousComputation thread grabs the latest request, | |
| the time of the request, and a thread that runs the `DesiredBalanceComputer`. The `ContinuousComputation` thread grabs the latest request, |
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.
Done
|
|
||
| There are different priorities in shard allocation, reflected in which moves the `DesiredBalancerReconciler` selects to do first given that | ||
| it can only move, recover, or remove a limited number of shards at once. The first priority is assigning unassigned shards, primaries being | ||
| more important than replicas. The second is to move shards that violate node resource limits or hard limits. The `AllocationDeciders` holds |
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.
violate node resource limits or hard limits
Really, violating any rule as defined by an AllocationDecider.
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.
Rephrased 👍
| There are different priorities in shard allocation, reflected in which moves the `DesiredBalancerReconciler` selects to do first given that | ||
| it can only move, recover, or remove a limited number of shards at once. The first priority is assigning unassigned shards, primaries being | ||
| more important than replicas. The second is to move shards that violate node resource limits or hard limits. The `AllocationDeciders` holds | ||
| a group of `AllocationDecider` types that place hard constraints on shard allocation. There is a decider that manages disk memory usage |
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.
There is a decider
Maybe name these deciders here so folks can go and look them up?
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.
Done
DiannaHohensee
left a comment
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.
Addressed the comments in 2a951eb
| The `DesiredBalanceShardsAllocator` is what runs shard allocation decisions. It leverages the `DesiredBalanceComputer` to produce | ||
| `DesiredBalance` instances for the cluster based on the latest cluster changes (add/remove nodes, create/remove indices, load, etc). Then | ||
| the `DesiredBalanceReconciler` is invoked to choose the next steps to take to move the cluster from the current shard allocation to the | ||
| latest computed `DesiredBalance` shard allocation. The `Reconciler` will apply changes to a copy of the `RoutingNodes`, which is then |
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.
Done
| Asynchronous completion of a new `DesiredBalance` will also invoke a reconciliation action, as will cluster state updates completing shard | ||
| moves/recoveries (unthrottling the next shard move/recovery). | ||
|
|
||
| The `ContinuousComputation` maintains a queue of desired balance computation requests, each of which holds the latest cluster information at |
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.
Fixed, thanks for catching that.
I guess the enqueued terminology got stuck in my head :)
| moves/recoveries (unthrottling the next shard move/recovery). | ||
|
|
||
| The `ContinuousComputation` maintains a queue of desired balance computation requests, each of which holds the latest cluster information at | ||
| the time of the request, and a thread that runs the `DesiredBalanceComputer`. The ContinuousComputation thread grabs the latest request, |
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.
Done
| There are different priorities in shard allocation, reflected in which moves the `DesiredBalancerReconciler` selects to do first given that | ||
| it can only move, recover, or remove a limited number of shards at once. The first priority is assigning unassigned shards, primaries being | ||
| more important than replicas. The second is to move shards that violate node resource limits or hard limits. The `AllocationDeciders` holds | ||
| a group of `AllocationDecider` types that place hard constraints on shard allocation. There is a decider that manages disk memory usage |
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.
Done
|
|
||
| There are different priorities in shard allocation, reflected in which moves the `DesiredBalancerReconciler` selects to do first given that | ||
| it can only move, recover, or remove a limited number of shards at once. The first priority is assigning unassigned shards, primaries being | ||
| more important than replicas. The second is to move shards that violate node resource limits or hard limits. The `AllocationDeciders` holds |
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.
Rephrased 👍
DaveCTurner
left a comment
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
This is a high-level overview of the main rebalancing components and
how they interact to move shards around the cluster, and decide where
shards should go.
Relates ES-10423
I haven't sold myself on the section titles, if anything better comes to mind.
@DaveCTurner not urgent to review this. Assigning to you because I'm not aware of anyone else already familiar with how this all works.