]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: start from `first` when older maps are trimmed 70103/head
authorKefu Chai <k.chai@proxmox.com>
Fri, 10 Jul 2026 06:17:12 +0000 (14:17 +0800)
committerKefu Chai <k.chai@proxmox.com>
Fri, 10 Jul 2026 06:51:33 +0000 (14:51 +0800)
_handle_osd_map() computes start = superblock.get_newest_map() + 1. A
freshly created OSD has get_newest_map() == 0, so start stays 1. When
such an OSD joins a cluster whose oldest map is already trimmed past
epoch 1, the gap [start, first - 1] is entirely below the trim lower
bound, so neither osdmap_subscribe guard above fires, and start stays 1.

store_maps() then stores only [first..last], but committed_osd_maps()
iterates from start=1 and calls get_local_map(1), which reads the
never-stored osdmap.1, hits ENOENT, and aborts. The OSD crash-loops
without ever activating a PG.

Clamp start to first in that case: the maps below first are gone, and
first is a full map, so it's a valid starting point. Classic OSD does
the same unconditionally via
start = std::max(superblock.get_newest_map() + 1, first).

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/crimson/osd/osd.cc

index 791338db7ac74544f80a1c690d7fd02aa0546834..acc6f18151183ee5b809eac4011b3e0aeca8a38f 100644 (file)
@@ -1190,6 +1190,7 @@ seastar::future<> OSD::_handle_osd_map(Ref<MOSDMap> m)
       co_return co_await get_shard_services().osdmap_subscribe(
         m->cluster_osdmap_trim_lower_bound - 1, true);
     }
+    start = first;
   }
 
   ceph::os::Transaction t;