From b43ee7b58b7bed07dcd29e11a2519b08ed271b41 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 15 Feb 2019 08:28:07 -0600 Subject: [PATCH] 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 --- src/osd/OSD.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; } -- 2.39.5