apache / apache/fluss

[server] Balance leaders within each table

Open
#3,871 1 comment 0 reactions 1 assignee Claimed by @fxbing View on GitHub
Dominant language
Java
Stars
2.1k
Forks
625
Avg merge
3d 14h
Merged PRs (30d)
97

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/fluss/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

- [x] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.