]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Fixed rank calculation logic for potential candidates when NFS daemon...
authorShweta Bhosale <Shweta.Bhosale1@ibm.com>
Mon, 23 Mar 2026 11:23:01 +0000 (16:53 +0530)
committerShweta Bhosale <Shweta.Bhosale1@ibm.com>
Tue, 30 Jun 2026 12:52:11 +0000 (18:22 +0530)
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 <Shweta.Bhosale1@ibm.com>
src/pybind/mgr/cephadm/schedule.py

index c6695994949e39a9924e620eb74169b8d404dee6..d2846a853cd77fed3943bfbcbec48c5e8baedf51 100644 (file)
@@ -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