]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: build_incremental_map_msg: recover if we are missing an incremental
authorSage Weil <sage@redhat.com>
Fri, 15 Feb 2019 14:28:07 +0000 (08:28 -0600)
committerSage Weil <sage@redhat.com>
Fri, 15 Feb 2019 14:44:59 +0000 (08:44 -0600)
If we are building a history and are missing an incremental, continue with
a full map in its place.

Generally speaking, an OSD should *always* have a full map stored, but
may not have the corresponding incremental for various reasons.

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

index 24741dc64455d674f53c76c270f3f3722200e9bc..c21451fbea96e230f8ce463d141e362d05e71b41 100644 (file)
@@ -1489,13 +1489,18 @@ MOSDMap *OSDService::build_incremental_map_msg(epoch_t since, epoch_t to,
   }
   for (epoch_t e = since + 1; e <= to; ++e) {
     bufferlist bl;
-    if (!get_inc_map_bl(e, bl)) {
+    if (get_inc_map_bl(e, bl)) {
+      m->incremental_maps[e].claim(bl);
+    } else {
       derr << __func__ << " missing incremental map " << e << dendl;
-      goto panic;
+      if (!get_map_bl(e, bl)) {
+       derr << __func__ << " also missing full map " << e << dendl;
+       goto panic;
+      }
+      m->maps[e].claim(bl);
     }
     max--;
     max_bytes -= bl.length();
-    m->incremental_maps[e].claim(bl);
     if (max <= 0 || max_bytes <= 0) {
       break;
     }