]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: check in with mon when no heartbeat peers
authorSage Weil <sage@newdream.net>
Thu, 31 Jul 2008 18:05:46 +0000 (11:05 -0700)
committerSage Weil <sage@newdream.net>
Thu, 31 Jul 2008 18:05:46 +0000 (11:05 -0700)
src/osd/OSD.cc

index d60025f0d1c2162172f1435d29b1a01fe9762e30..a72411c84fda4e9d73eb8580827a57bf243609c7 100644 (file)
@@ -954,6 +954,16 @@ void OSD::heartbeat()
   if (logger) logger->set("hbto", heartbeat_to.size());
   if (logger) logger->set("hbfrom", heartbeat_from.size());
 
+  
+  // hmm.. am i all alone?
+  if (heartbeat_from.empty() || heartbeat_to.empty()) {
+    dout(10) << "i have no heartbeat peers; checking mon for new map" << dendl;
+    int mon = monmap->pick_mon();
+    messenger->send_message(new MOSDGetMap(monmap->fsid, osdmap->get_epoch()+1),
+                            monmap->get_inst(mon));
+  }
+
+
   // hack: fake reorg?
   if (osdmap && g_conf.fake_osdmap_updates) {
     int mon = monmap->pick_mon();