Gabriella Lotz has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24476 )

Change subject: KUDU-3767 Add global leader awareness to auto leader rebalancer 
(Part 2)
......................................................................


Patch Set 2:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/24476/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/24476/1//COMMIT_MSG@7
PS1, Line 7: Add global leader awareness to auto leader rebalancer (Part 2)
> Thanks for working on this!
Thanks for the questions!

1. I don't think the {7,2,0} case can actually happen. For a 9-tablet, RF=3 
table on 3 tservers, each tserver should end up with 3 leaders, and the 
existing per-table rebalancer (KUDU-3390/KUDU-3497) will keep moving leaders 
off tserver1 until it gets there. On top of that, my global pass only runs once 
per-table balancing has nothing left to do that round, so it won't even kick in 
while a table still needs fixing. So {7,2,0} shouldn't stick around, no matter 
how even the cluster total looks.

The only per-table unevenness you can really end up with is being off by one 
when the tablets don't divide evenly (e.g. 10 tablets on 3 tservers ? {4,3,3}). 
One caveat: if a table doesn't have a replica on some tserver (which happens 
when RF is less than the number of tservers, or a tserver is in maintenance), 
its leaders can't go there, so per-table balance is limited by where the 
replicas live. But that's a placement thing, not something these patches change.

2. Per-table balance comes first for every table, and the global pass isn't 
allowed to make any table more skewed, so a hot table always stays balanced. 
The global pass only gets to decide which tserver carries the extra leader when 
a table doesn't divide evenly.

I didn't add a way to prioritize one table over another, but I don't think 
there's much to gain, since each table is already as balanced as it can be and 
a hot table already gets that. If you wanted to pin a specific table's extra 
leader to a specific tserver, that'd probably need a new feature.

3. Yes, that's how it works without KUDU-3767, and it's basically why I worked 
on it. Before this patch, each table was balanced on its own with nothing 
looking at the cluster as a whole, so every table was fine individually, but 
the totals could drift, and the same tserver could keep collecting the extra 
leader across many tables and end up overloaded. KUDU-3767 fixes that part 
while keeping the per-table behavior the same.


http://gerrit.cloudera.org:8080/#/c/24476/1/src/kudu/master/auto_leader_rebalancer-test.cc
File src/kudu/master/auto_leader_rebalancer-test.cc:

http://gerrit.cloudera.org:8080/#/c/24476/1/src/kudu/master/auto_leader_rebalancer-test.cc@709
PS1, Line 709:   ASSERT_OK(MakeLeaderDistribution(table1_dist, kTable1Name));
> The two new tests share ~80% identical code (the global_distribution lambda
Done


http://gerrit.cloudera.org:8080/#/c/24476/1/src/kudu/master/auto_leader_rebalancer.h
File src/kudu/master/auto_leader_rebalancer.h:

http://gerrit.cloudera.org:8080/#/c/24476/1/src/kudu/master/auto_leader_rebalancer.h@99
PS1, Line 99: ceili
> shouldn't this be ceiling?
Done


http://gerrit.cloudera.org:8080/#/c/24476/1/src/kudu/master/auto_leader_rebalancer.cc
File src/kudu/master/auto_leader_rebalancer.cc:

http://gerrit.cloudera.org:8080/#/c/24476/1/src/kudu/master/auto_leader_rebalancer.cc@638
PS1, Line 638: // skipping a transfer (e.g. the destination enters maintenance 
mode or
             :       // the leader can no longer be looked up), so these counts 
can drift from
             :       // what actually transferred; that is fine, the next round 
rebuilds the
             :       // distribution from scratch.
> The bookkeeping updates here (global_leader_count[source]--, [dest]++) happ
Done



--
To view, visit http://gerrit.cloudera.org:8080/24476
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5d44761f6444ca1d1bf4fcee405d65d029e41980
Gerrit-Change-Number: 24476
Gerrit-PatchSet: 2
Gerrit-Owner: Gabriella Lotz <[email protected]>
Gerrit-Reviewer: Ashwani Raina <[email protected]>
Gerrit-Reviewer: Gabriella Lotz <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Reviewer: Zoltan Chovan <[email protected]>
Gerrit-Comment-Date: Thu, 25 Jun 2026 15:09:04 +0000
Gerrit-HasComments: Yes

Reply via email to