]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: build_incremental_map_msg: behave if we have latest full but not incremental
authorSage Weil <sage@redhat.com>
Fri, 15 Feb 2019 14:25:19 +0000 (08:25 -0600)
committerNathan Cutler <ncutler@suse.com>
Wed, 4 Dec 2019 12:11:26 +0000 (13:11 +0100)
Fixes 47a3f63ef71522d6b9572e81674598dd3e19df9d and
follow-on 57a13adc8d0e34b4bb1a4022eacbb3de2636df53

Fixes: http://tracker.ceph.com/issues/38330
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit e861f03b943653a1b3f595d31e1f25a482a9482b)

src/osd/OSD.cc

index a421c9b50b040e87b83ca02bf592f59b644fdcc7..52211fb097743a6eba9c315c54045ee52b636857 100644 (file)
@@ -1323,11 +1323,17 @@ MOSDMap *OSDService::build_incremental_map_msg(epoch_t since, epoch_t to,
   }
   // send something
   bufferlist bl;
-  if (!get_inc_map_bl(m->newest_map, bl)) {
+  if (get_inc_map_bl(m->newest_map, bl)) {
+    m->incremental_maps[m->newest_map].claim(bl);
+  } else {
     derr << __func__ << " unable to load latest map " << m->newest_map << dendl;
-    ceph_abort();
+    if (!get_map_bl(m->newest_map, bl)) {
+      derr << __func__ << " unable to load latest full map " << m->newest_map
+          << dendl;
+      ceph_abort();
+    }
+    m->maps[m->newest_map].claim(bl);
   }
-  m->incremental_maps[m->newest_map].claim(bl);
   return m;
 }