]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
* be slightly less dumb about sending initial osdmap to clients
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 6 Jun 2007 22:35:20 +0000 (22:35 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 6 Jun 2007 22:35:20 +0000 (22:35 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1404 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/mon/OSDMonitor.cc
trunk/ceph/mon/OSDMonitor.h

index ee5caaec0f0251aabb912cbcd2309be04fb0d37c..38b7616722d4ebe53b29077b3b3e2a9469b8d56a 100644 (file)
@@ -527,11 +527,26 @@ void OSDMonitor::send_waiting()
 
   for (map<entity_name_t,pair<entity_inst_t,epoch_t> >::iterator i = awaiting_map.begin();
        i != awaiting_map.end();
-       i++)
-    send_incremental(i->second.second, i->second.first);
+       i++) {
+    if (i->second.second)
+      send_incremental(i->second.second, i->second.first);
+    else
+      send_full(i->second.first);
+  }
 }
 
 
+void OSDMonitor::send_latest(entity_inst_t who)
+{
+  // FIXME this is super naive
+  if (osdmap.get_epoch() == 0) {
+    awaiting_map[who.name].first = who;
+    awaiting_map[who.name].second = 0;
+  } else {
+    send_full(who);
+  }
+}
+
 void OSDMonitor::send_full(entity_inst_t who)
 {
   messenger->send_message(new MOSDMap(&osdmap), who);
index 18dc9f3a7943e8f26f08faf34361205af9b7bed6..000a79f4024bcfa37efa8ec026564bf4d5a02929 100644 (file)
@@ -103,9 +103,7 @@ private:
 
   void mark_all_down();
 
-  void send_latest(entity_inst_t i) {
-    send_full(i);
-  }
+  void send_latest(entity_inst_t i);
 
   void fake_osd_failure(int osd, bool down);
   void fake_osdmap_update();