From: Shweta Bhosale Date: Mon, 23 Mar 2026 11:23:01 +0000 (+0530) Subject: mgr/cephadm: Fixed rank calculation logic for potential candidates when NFS daemon... X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e33edc889021f4631a73ab1dd565963c52bbff12;p=ceph.git mgr/cephadm: Fixed rank calculation logic for potential candidates when NFS daemon colocation is enabled When colocation of NFS daemons is allowed, the existing rank calculation incorrectly derives the rank based solely on the number of hosts. This leads to inaccurate rank assignment because the logic does not account for the full set of potential candidates, especially in scenarios where multiple daemons can reside on the same host. Fixes: https://tracker.ceph.com/issues/73442 Signed-off-by: Shweta Bhosale --- diff --git a/src/pybind/mgr/cephadm/schedule.py b/src/pybind/mgr/cephadm/schedule.py index c6695994949..d2846a853cd 100644 --- a/src/pybind/mgr/cephadm/schedule.py +++ b/src/pybind/mgr/cephadm/schedule.py @@ -401,7 +401,7 @@ class HostAssignment(object): existing_slots: List[DaemonPlacement] = [] to_add: List[DaemonPlacement] = [] to_remove: List[orchestrator.DaemonDescription] = [] - ranks: List[int] = list(range(len(all_candidates))) + ranks: List[int] = list(range(len(all_candidates if len(all_candidates) > len(candidates) else candidates))) others: List[DaemonPlacement] = candidates.copy() for dd in daemons: found = False