From: Timothy Q Nguyen Date: Wed, 28 Jan 2026 17:01:52 +0000 (-0800) Subject: mgr/cephadm: verify spec service_id before applying X-Git-Tag: v21.0.1~170^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fbe3a053c2a2bee19a4e8302a94bcc7af7e156d3;p=ceph.git mgr/cephadm: verify spec service_id before applying There are scenarios where the wrong spec is applied to the wrong OSDs, likely due to some unknown process interruption or corruption of cache data, to mitigate this issue I added a check for OSDs service_id to match the spec service_id. Fixes: https://tracker.ceph.com/issues/74885 Signed-off-by: Timothy Q Nguyen --- diff --git a/src/pybind/mgr/cephadm/services/osd.py b/src/pybind/mgr/cephadm/services/osd.py index 60a399149f9..ecd91f34c85 100644 --- a/src/pybind/mgr/cephadm/services/osd.py +++ b/src/pybind/mgr/cephadm/services/osd.py @@ -126,6 +126,9 @@ class OSDService(CephService): if osd['tags']['ceph.cluster_fsid'] != fsid: logger.debug('mismatched fsid, skipping %s' % osd) continue + if osd['tags']['ceph.osdspec_affinity'] != spec.service_id: + logger.debug('mismatched service id, skipping %s' % osd) + continue if osd_id in before_osd_uuid_map and osd_id not in replace_osd_ids: # if it exists but is part of the replacement operation, don't skip continue