]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSD: cleanup send_incremental_map
authorMatan Breizman <mbreizma@redhat.com>
Tue, 14 Nov 2023 14:36:58 +0000 (14:36 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 18 Dec 2023 13:19:08 +0000 (13:19 +0000)
See: 9fba69a11aa940ed36339bb24b05cb92165db516

build_incremental_map_msg() no longer returns NULL on failures.
while(!m) if-case is removed.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/osd/OSD.cc

index a79b388deca4ac8c2cc78b96587d82eb8ef3dfb3..d62695ae1c62e60f483168e9e093c92cf23de279 100644 (file)
@@ -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;
     }