Skip to content

[server] Balance leaders within each table #3871

Description

@fxbing

Search before asking

  • I searched in the issues and found nothing similar.

Description

Description

The current LeaderReplicaDistributionGoal balances leader counts across the whole cluster. However, leaders of an individual table can still be unevenly distributed.

For a hot table, this may cause significant CPU and request-load differences between TabletServers even when the cluster-wide leader count is balanced.

Proposed solution

Make leader balancing table-aware:

  • Balance leaders independently within each table when replica placement permits.
  • Prefer leadership movement between existing replicas.
  • Move replicas when necessary to achieve table-level leader balance, such as during cluster expansion.
  • Preserve rack awareness and the existing replica distribution constraints.
  • Keep cluster-level leader balancing as a complementary goal.

Willingness to contribute

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions