]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix build_incremental_map_msg
authorSage Weil <sage.weil@dreamhost.com>
Wed, 14 Dec 2011 17:31:17 +0000 (09:31 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Wed, 14 Dec 2011 17:31:17 +0000 (09:31 -0800)
We keep both the inc and the full for our oldest osdmap.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/OSD.cc

index bb154ca020543318fc0119f3fc759727da8bdbe4..9b3d2378c316943f55a7b85a87e22557aca31939 100644 (file)
@@ -3648,18 +3648,18 @@ MOSDMap *OSD::build_incremental_map_msg(epoch_t since, epoch_t to)
   m->oldest_map = superblock.oldest_map;
   m->newest_map = superblock.newest_map;
   
-  for (epoch_t e = to;
-       e > since;
-       e--) {
+  for (epoch_t e = to; e > since; e--) {
     bufferlist bl;
-    if (get_inc_map_bl(e,bl)) {
+    if (e > m->oldest_map && get_inc_map_bl(e, bl)) {
       m->incremental_maps[e].claim(bl);
-    } else if (get_map_bl(e,bl)) {
+    } else if (get_map_bl(e, bl)) {
       m->maps[e].claim(bl);
       break;
-    }
-    else {
-      assert(0);  // we should have all maps.
+    } else {
+      derr << "since " << since << " to " << to
+          << " oldest " << m->oldest_map << " newest " << m->newest_map
+          << dendl;
+      assert(0 == "missing an osdmap on disk");  // we should have all maps.
     }
   }
   return m;