Song Jiacheng has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/20310


Change subject: KUDU-3497 optimize leader rebalancer algorithm Leader 
rebalancer might not work well for now, especilally for the tables who have 
less hash buckets and replication factors. For instance, for a table, consist 
of 9 tablets, 3 replication factor, in a 3-tser
......................................................................

KUDU-3497 optimize leader rebalancer algorithm
Leader rebalancer might not work well for now, especilally for
the tables who have less hash buckets and replication factors.
For instance, for a table, consist of 9 tablets, 3 replication
factor, in a 3-tservers cluster.

Its leaders distribution is as follow:

Tablet server A : 4
Tablet server B : 4
Tablet server C : 1

According to the algorithm for now, there will not be any rebalance
operation scheduled.

Therefore, try to find a better algorithm to make it always find
the best leader distribution.

The formula is:
expected leader num = (tablets sum) % (tablets server num) = 0 ?
(tablets sum) / (tablets server num) :
ceil((tablets sum) / (tablets server num))
A tserver whose leader num is more than the expected value needs
to transfer the leaderships.

So the leader skew will never be more than 1.

Change-Id: I0f1fe796fd98da2d8764da793b7e254319e6348a
---
M src/kudu/master/auto_leader_rebalancer.cc
1 file changed, 30 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/10/20310/1
--
To view, visit http://gerrit.cloudera.org:8080/20310
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f1fe796fd98da2d8764da793b7e254319e6348a
Gerrit-Change-Number: 20310
Gerrit-PatchSet: 1
Gerrit-Owner: Song Jiacheng <[email protected]>

Reply via email to