From: Bill Scales Date: Fri, 15 May 2026 14:39:25 +0000 (+0100) Subject: osd: Fix bug when calculating min_peer_features X-Git-Tag: v21.0.1~120^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F68936%2Fhead;p=ceph.git osd: Fix bug when calculating min_peer_features PeeringState calculates the minimum set of features for the set of OSDs within a PG. There is a bug when the peer info has already been cached where these peers features are not included in the calculation. This can lead to the min feature set including features that not all OSDs have. Previously this just made some asserts less aggressive than they should have been. Pull request https://github.com/ceph/ceph/pull/57740 uses min_peer_features to decide how to encode messages to other OSDs. Midway through an upgrade this bug can cause an OSD to send the wrong version of a message to a downlevel OSD causing it to abort. Fixes: https://tracker.ceph.com/issues/76600 Signed-off-by: Bill Scales --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 66a14168580..8fca10435fe 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -7535,7 +7535,10 @@ void PeeringState::GetInfo::get_infos() continue; } if (ps->peer_info.count(peer)) { - psdout(10) << " have osd." << peer << " info " << ps->peer_info[peer] << dendl; + uint64_t f = ps->get_osdmap()->get_xinfo(peer.osd).features; + psdout(10) << " have osd." << peer << " info " << ps->peer_info[peer] + << " peer features: " << hex << f << dec << dendl; + ps->apply_peer_features(f); continue; } if (peer_info_requested.count(peer)) {