]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon: start lease timer from peon_init()
authorSage Weil <sage@inktank.com>
Sat, 1 Jun 2013 00:09:19 +0000 (17:09 -0700)
committerSage Weil <sage@inktank.com>
Sun, 2 Jun 2013 23:34:18 +0000 (16:34 -0700)
commitffb87918fa7b829a5199eec08804dc540a819bf2
tree3874e0087e28d1225f27eb5ea143508067b18350
parent38f8d850d35500e3d8751cd14c5cdaaff682c7d7
mon: start lease timer from peon_init()

In the scenario:

 - leader wins, peons lose
 - leader sees it is too far behind on paxos and bootstraps
 - leader tries to sync with someone, waits for a quorum of the others
 - peons sit around forever waiting

The problem is that they never time out because paxos never issues a lease,
which is the normal timeout that lets them detect a leader failure.

Avoid this by starting the lease timeout as soon as we lose the election.
The timeout callback just does a bootstrap and does not rely on any other
state.

I see one possible danger here: there may be some "normal" cases where the
leader takes a long time to issue its first lease that we currently
tolerate, but won't with this new check in place.  I hope that raising
the lease interval/timeout or reducing the allowed paxos drift will make
that a non-issue.  If it is problematic, we will need a separate explicit
"i am alive" from the leader while it is getting ready to issue the lease
to prevent a live-lock.

Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit f1ccb2d808453ad7ef619c2faa41a8f6e0077bd9)
src/mon/Paxos.cc
src/mon/Paxos.h