]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
merged trunk changes r1394:1405 into branches/sage/cephmds2
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 6 Jun 2007 22:38:09 +0000 (22:38 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 6 Jun 2007 22:38:09 +0000 (22:38 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1406 29311d96-e01e-0410-9327-a35deaab8ce9

branches/sage/cephmds2/client/Client.cc
branches/sage/cephmds2/messages/MOSDMap.h
branches/sage/cephmds2/mon/OSDMonitor.cc
branches/sage/cephmds2/mon/OSDMonitor.h

index 0ff62aacbd996cd76c842afaea220e3a3ccd493f..7682524f81325d2f397a1b897cf1b88f9cd34718 100644 (file)
@@ -1264,7 +1264,9 @@ int Client::mount()
   dout(2) << "sending client_mount to mon" << mon << endl;
   messenger->send_message(new MClientMount, monmap->get_inst(mon));
   
-  while (!mdsmap)
+  while (!mdsmap ||
+        !osdmap || 
+        osdmap->get_epoch() == 0)
     mount_cond.Wait(client_lock);
   
   mounted = true;
index ee75f9bff9b69f5c2bc63427b271edae33ddf828..83929ddd23c2812724d9bb3c2059148418351d01 100644 (file)
@@ -65,6 +65,9 @@ class MOSDMap : public Message {
   }
 
   virtual char *get_type_name() { return "omap"; }
+  void print(ostream& out) {
+    out << "osdmap(" << get_first() << "," << get_last() << ")";
+  }
 };
 
 #endif
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();