Use a single setting to enable/disable primary shard balance/rebalance #17362
Labels
enhancement
Enhancement or improvement to existing feature or request
ShardManagement:Placement
untriaged
Is your feature request related to a problem? Please describe
Today, we use settings
cluster.routing.allocation.balance.prefer_primary
andcluster.routing.allocation.rebalance.primary.enable
to enable/disable primary shard balance and rebalance separately.OpenSearch/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java
Lines 320 to 330 in 9de21d1
But it is wired that we also enable the constraint
INDEX_PRIMARY_SHARD_BALANCE_CONSTRAINT_ID
inRebalanceConstraints
when settingscluster.routing.allocation.balance.prefer_primary
as true, by definition, it should be controlled by the rebalance configuration.On the other hand, just turning on AllocationConstraints doesn't do much good, as it may still cause the primary shards to become unbalanced during rebalance.
Describe the solution you'd like
Use a single setting
cluster.routing.allocation.balance.prefer_primary
to control primary shard balance and rebalance, deprecate the settingcluster.routing.allocation.rebalance.primary.enable
and remove it in OS 3.0.Related component
ShardManagement:Placement
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: