]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: paxos add the timeout function when peon recovery 10359/head
authorsongbaisen <song.baisen@zte.com.cn>
Wed, 20 Jul 2016 01:14:00 +0000 (09:14 +0800)
committersongbaisen <song.baisen@zte.com.cn>
Wed, 20 Jul 2016 01:14:00 +0000 (09:14 +0800)
 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 <song.baisen@zte.com.cn>
src/mon/Paxos.cc

index c294fb26d1ce614b236e8413b1971b782804d13a..49948b63b1d93b5d7d4295ee027d4734ba3afd72 100644 (file)
@@ -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<MMonPaxos*>(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"