]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: reset heartbeat peer set on osd down
authorSage Weil <sage@newdream.net>
Fri, 8 May 2009 19:55:16 +0000 (12:55 -0700)
committerSage Weil <sage@newdream.net>
Fri, 8 May 2009 19:58:23 +0000 (12:58 -0700)
This clears out the timers.

src/osd/OSD.cc
src/osd/OSD.h

index 0ec1f69a3a32e869a4007c487e5bc18a639fdbaa..e1d19579250b4f7e380d279d44671d480d3a6ada 100644 (file)
@@ -936,6 +936,17 @@ void OSD::update_heartbeat_peers()
   heartbeat_lock.Unlock();
 }
 
+void OSD::reset_heartbeat_peers()
+{
+  dout(10) << "reset_heartbeat_peers" << dendl;
+  heartbeat_lock.Lock();
+  heartbeat_to.clear();
+  heartbeat_from.clear();
+  heartbeat_from_stamp.clear();
+  heartbeat_inst.clear();
+  heartbeat_lock.Unlock();
+}
+
 void OSD::handle_osd_ping(MOSDPing *m)
 {
   dout(20) << "handle_osd_ping from " << m->get_source() << " got stat " << m->peer_stat << dendl;
@@ -1908,6 +1919,8 @@ void OSD::handle_osd_map(MOSDMap *m)
 
     state = STATE_BOOTING;
     boot_epoch = 0;
+
+    reset_heartbeat_peers();
   }
 
 
index d314a2cbecede70f6ab527a62695b5a9b2644041..56abad447e4f3524d87a8193c4ba4ee8e3d9826f 100644 (file)
@@ -171,6 +171,7 @@ private:
   Messenger *heartbeat_messenger;
   
   void update_heartbeat_peers();
+  void reset_heartbeat_peers();
   void heartbeat();
   void heartbeat_entry();