-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Feature Request] [Segment Replication] Balanced primary count across all nodes during rebalancing #12250
Description
Is your feature request related to a problem? Please describe
Currently in our system, we only have contraint for the primary shards rebalance at an index level which was introduced in #6422. Though there are cases when we need to consider the overall primary shards count in the nodes. For example:
Initial configuration
Let's assume we have 5 node setup and 5 indices each having 5 primary and 1 replica configuration.
| NodeID | Primary | Replica |
|---|---|---|
| Node1 | 5 | 5 |
| Node2 | 5 | 5 |
| Node3 | 5 | 5 |
| Node4 | 5 | 5 |
| Node5 | 5 | 5 |
Case 1:
When we drop one node, the new distribution looks like this:
| NodeID | Primary | Replica |
|---|---|---|
| Node1 | 10 | 2 |
| Node2 | 5 | 8 |
| Node3 | 5 | 7 |
| Node4 | 5 | 8 |
a better distribution could be:
| NodeID | Primary | Replica |
|---|---|---|
| Node1 | 6 | 6 |
| Node2 | 6 | 6 |
| Node3 | 6 | 7 |
| Node4 | 7 | 6 |
In case, we have added another node in the initial configuration, the node distribution looks like this:
Case2:
| NodeID | Primary | Replica |
|---|---|---|
| Node1 | 5 | 3 |
| Node2 | 5 | 3 |
| Node3 | 5 | 4 |
| Node4 | 5 | 3 |
| Node5 | 5 | 3 |
| Node6 | 0 | 9 |
Similary for this case, a better distribution could be:
| NodeID | Primary | Replica |
|---|---|---|
| Node1 | 4 | 4 |
| Node2 | 4 | 4 |
| Node3 | 4 | 4 |
| Node4 | 4 | 4 |
| Node5 | 4 | 5 |
| Node6 | 5 | 4 |
We can clearly see that the primary shards are skewed in both the cases distribution and we can have better distributions in the nodes during rebalancing.
Describe the solution you'd like
Related component
Storage:Performance
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status