Hello Marton Greber, Kudu Jenkins,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/24946

to look at the new patch set (#3).

Change subject: KUDU-3733 run auto-leader-rebalancer at startup
......................................................................

KUDU-3733 run auto-leader-rebalancer at startup

RunLoop() slept for --auto_leader_rebalancing_interval_seconds before
its first pass, leaving the auto-leader-rebalancer idle for up to an
hour after master startup or failover.

Running a pass immediately isn't enough on its own: the thread is
created while the catalog manager is still initializing, so that pass
no-ops on the leadership check and the loop sleeps out the interval
anyway. The interval says how often to rebalance, not how long to
sleep, so separate the two. The loop now polls every 5 seconds and
decides whether a pass is due from when the last one ran; only a pass
that got past the leadership check advances that timestamp.

While here, clamp the interval to a second. The flag has no validator
and is runtime settable, so 0 is reachable, and at 0 the loop never
sleeps and spins on RunLeaderRebalancer() (~14k passes in 3 seconds,
measured). That spin predates this patch and isn't made worse by it,
but the clamp is cheap, and reading the interval once for both the
poll and the due check beats reading the flag in two places.

Adds LeaderRebalancerTest.FirstPassDoesNotWaitOutFullInterval, which
fails against the old loop, and ZeroIntervalDoesNotSpin, which fails
without the clamp.

Change-Id: I3c1b2a5622578c14a414fc79e4c527f9f7efbbce
---
M src/kudu/master/auto_leader_rebalancer-test.cc
M src/kudu/master/auto_leader_rebalancer.cc
M src/kudu/master/auto_leader_rebalancer.h
3 files changed, 96 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/46/24946/3
--
To view, visit http://gerrit.cloudera.org:8080/24946
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3c1b2a5622578c14a414fc79e4c527f9f7efbbce
Gerrit-Change-Number: 24946
Gerrit-PatchSet: 3
Gerrit-Owner: Gabriella Lotz <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>

Reply via email to