]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix map epoch check in handle_osd_map
authorSage Weil <sage.weil@dreamhost.com>
Wed, 5 Oct 2011 18:13:13 +0000 (11:13 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Wed, 5 Oct 2011 18:13:23 +0000 (11:13 -0700)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/messages/MOSDMap.h
src/osd/OSD.cc

index 74977812c8fdfb2c1e939c0a58299565af80eca5..fa3bd9a4cdbf9fe0834bd2e3780f8d5bf6b7f896 100644 (file)
@@ -108,7 +108,10 @@ public:
 
   const char *get_type_name() { return "omap"; }
   void print(ostream& out) {
-    out << "osd_map(" << get_first() << "," << get_last() << ")";
+    out << "osd_map(" << get_first() << ".." << get_last();
+    if (oldest_map || newest_map)
+      out << " src has " << oldest_map << ".." << newest_map;
+    out << ")";
   }
 };
 
index 8ad00c862da8a115f5a756a2ab47c3906e266950..064b5741d7c621cb8d87ce78fc914046c3a94d3d 100644 (file)
@@ -3018,7 +3018,10 @@ void OSD::handle_osd_map(MOSDMap *m)
 
   epoch_t first = m->get_first();
   epoch_t last = m->get_last();
-  dout(3) << "handle_osd_map epochs [" << first << "," << last << "], i have " << osdmap->get_epoch() << dendl;
+  dout(3) << "handle_osd_map epochs [" << first << "," << last << "], i have "
+         << osdmap->get_epoch()
+         << ", src has [" << m->oldest_map << "," << m->newest_map << "]"
+         << dendl;
 
   if (logger) {
     logger->inc(l_osd_map);
@@ -3039,7 +3042,8 @@ void OSD::handle_osd_map(MOSDMap *m)
   if (first > osdmap->get_epoch() + 1) {
     dout(10) << "handle_osd_map message skips epochs " << osdmap->get_epoch() + 1
             << ".." << (first-1) << dendl;
-    if (m->oldest_map && m->oldest_map <= osdmap->get_epoch()) {
+    if ((m->oldest_map < first && osdmap->get_epoch() == 0) ||
+       m->oldest_map <= osdmap->get_epoch()) {
       monc->sub_want("osdmap", osdmap->get_epoch()+1, CEPH_SUBSCRIBE_ONETIME);
       monc->renew_subs();
       m->put();