From: Sage Weil Date: Fri, 15 Feb 2019 14:28:07 +0000 (-0600) Subject: osd: build_incremental_map_msg: recover if we are missing an incremental X-Git-Tag: v14.1.0~93^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b43ee7b58b7bed07dcd29e11a2519b08ed271b41;p=ceph.git osd: build_incremental_map_msg: recover if we are missing an incremental 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 24741dc6445..c21451fbea9 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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; }