]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: avoid ceph_abort in build_incremental_map_msg when newest_map is missing 67253/head
authorVinayak Tiwari <tiwarivinayak10@gmail.com>
Sun, 8 Feb 2026 08:24:29 +0000 (13:54 +0530)
committerLaura Flores <lflores@ibm.com>
Fri, 10 Apr 2026 18:32:05 +0000 (13:32 -0500)
When sharing OSD maps with a peer (e.g. during heartbeat in
maybe_share_map), we may have already trimmed the requested range or
newest_map (e.g. trim race, or store read failure). In that case the
panic path tried to send newest_map; if it could not be loaded, the
code called ceph_abort() and crashed the OSD.

Log and return an empty MOSDMap instead of aborting. The receiver drops
such messages (last <= superblock.get_newest_map()) and can re-request
from the mon.

Fixes: https://tracker.ceph.com/issues/74800
Signed-off-by: Vinayak Tiwari <tiwarivinayak10@gmail.com>
src/osd/OSD.cc

index e3b5641a248a21e2383e691c289e5f2ca0a34dab..37ac2b52effe9007f2caa5c3d4818681c1fc396d 100644 (file)
@@ -1474,18 +1474,17 @@ MOSDMap *OSDService::build_incremental_map_msg(epoch_t since, epoch_t to,
     // send what we have so far
     return m;
   }
-  // send something
+  // send something if we can
   bufferlist bl;
   if (get_inc_map_bl(m->newest_map, bl)) {
     m->incremental_maps[m->newest_map] = std::move(bl);
-  } else {
-    derr << __func__ << " unable to load latest map " << m->newest_map << dendl;
-    if (!get_map_bl(m->newest_map, bl)) {
-      derr << __func__ << " unable to load latest full map " << m->newest_map
-          << dendl;
-      ceph_abort();
-    }
+  } else if (get_map_bl(m->newest_map, bl)) {
     m->maps[m->newest_map] = std::move(bl);
+  } else {
+    derr << __func__ << " unable to load latest map " << m->newest_map
+        << ", sending empty map message (peer will drop or re-request from mon)"
+        << dendl;
+
   }
   return m;
 }