From 05795cd7f3db4e0cb2db3a34993db10c2aede1b3 Mon Sep 17 00:00:00 2001 From: songbaisen Date: Wed, 20 Jul 2016 09:14:00 +0800 Subject: [PATCH] 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 --- src/mon/Paxos.cc | 4 ++++ 1 file changed, 4 insertions(+) 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" -- 2.47.3