]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: adjust heartbeat peer lock
authorSage Weil <sage@newdream.net>
Fri, 8 May 2009 19:55:37 +0000 (12:55 -0700)
committerSage Weil <sage@newdream.net>
Fri, 8 May 2009 19:58:23 +0000 (12:58 -0700)
Need it to protect heartbeat_from_stamp.

src/osd/OSD.cc

index e1d19579250b4f7e380d279d44671d480d3a6ada..0c0d460f48a1dfc77a9c66e8600800c8170e905f 100644 (file)
@@ -1664,6 +1664,7 @@ void OSD::wait_for_new_map(Message *m)
 void OSD::note_down_osd(int osd)
 {
   messenger->mark_down(osdmap->get_addr(osd));
+
   heartbeat_lock.Lock();
   if (heartbeat_inst.count(osd)) {
     if (heartbeat_inst[osd] == osdmap->get_hb_inst(osd)) {
@@ -1675,12 +1676,13 @@ void OSD::note_down_osd(int osd)
     }
   } else
     dout(10) << "note_down_osd no heartbeat_inst for osd" << osd << dendl;
-  heartbeat_lock.Unlock();
 
   peer_map_epoch.erase(entity_name_t::OSD(osd));
   failure_queue.erase(osd);
   failure_pending.erase(osd);
   heartbeat_from_stamp.erase(osd);
+
+  heartbeat_lock.Unlock();
 }
 void OSD::note_up_osd(int osd)
 {