From: songbaisen Date: Wed, 20 Jul 2016 01:14:00 +0000 (+0800) Subject: mon: paxos add the timeout function when peon recovery X-Git-Tag: v11.1.0~558^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=05795cd7f3db4e0cb2db3a34993db10c2aede1b3;p=ceph.git mon: paxos add the timeout function when peon recovery Now the peon only have 10s from init to active.But when the leader from init to active he may start twice or more recovery collect when meet a higher pn than himself.It means the leader from init to active may spend more than 10S.So it is not reasonable for the peon only have one 10s timeout event. Signed-off-by: song baisen --- diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index c294fb26d1ce..49948b63b1d9 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -195,6 +195,7 @@ void Paxos::collect(version_t oldpn) // peon void Paxos::handle_collect(MonOpRequestRef op) { + op->mark_paxos_event("handle_collect"); MMonPaxos *collect = static_cast(op->get_req()); @@ -205,6 +206,9 @@ void Paxos::handle_collect(MonOpRequestRef op) // we're recoverying, it seems! state = STATE_RECOVERING; + //update the peon recovery timeout + reset_lease_timeout(); + if (collect->first_committed > last_committed+1) { dout(2) << __func__ << " leader's lowest version is too high for our last committed"