pub fn preferred_rebalance_admission(
changes: &[PreferredLeaderChange],
max_changes: usize,
) -> boolExpand description
Admit one preferred-leader rebalance batch only when it is nonempty, within the per-tick election cap, and every change in it is a KIP-460 preferred election.
There is no imbalance-ratio threshold among the facts. That gate is the
ZooKeeper controller’s leader.imbalance.per.broker.percentage; the
KRaft controller krabka follows restores every partition whose preferred
replica is eligible, and bounds the work by a per-tick election count
(QuorumController.MAX_ELECTIONS_PER_IMBALANCE), which is max_changes.