From 66dceb24d6d0779f87fd4ac3c1226534cc91e216 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Tue, 14 Nov 2023 14:36:58 +0000 Subject: [PATCH] osd/OSD: cleanup send_incremental_map See: 9fba69a11aa940ed36339bb24b05cb92165db516 build_incremental_map_msg() no longer returns NULL on failures. while(!m) if-case is removed. Signed-off-by: Matan Breizman --- src/osd/OSD.cc | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index a79b388deca4a..d62695ae1c62e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1457,22 +1457,19 @@ void OSDService::send_incremental_map(epoch_t since, Connection *con, << " to " << con << " " << con->get_peer_addr() << dendl; MOSDMap *m = NULL; - while (!m) { - OSDSuperblock sblock(get_superblock()); - if (since < sblock.get_oldest_map()) { - // just send latest full map - MOSDMap *m = new MOSDMap(monc->get_fsid(), - osdmap->get_encoding_features()); - m->cluster_osdmap_trim_lower_bound = sblock.cluster_osdmap_trim_lower_bound; - m->newest_map = sblock.get_newest_map(); - get_map_bl(to, m->maps[to]); - send_map(m, con); - return; - } - + OSDSuperblock sblock(get_superblock()); + if (since < sblock.get_oldest_map()) { + // just send latest full map + m = new MOSDMap(monc->get_fsid(), + osdmap->get_encoding_features()); + m->cluster_osdmap_trim_lower_bound = sblock.cluster_osdmap_trim_lower_bound; + m->newest_map = sblock.get_newest_map(); + get_map_bl(to, m->maps[to]); + } else { if (to > since && (int64_t)(to - since) > cct->_conf->osd_map_share_max_epochs) { - dout(10) << " " << (to - since) << " > max " << cct->_conf->osd_map_share_max_epochs - << ", only sending most recent" << dendl; + dout(10) << " " << (to - since) << " > max " + << cct->_conf->osd_map_share_max_epochs + << ", only sending most recent" << dendl; since = to - cct->_conf->osd_map_share_max_epochs; } -- 2.39.5