]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/DaemonServer: Re-order OSDs in crush bucket to maximize OSDs for upgrade 66108/head
authorSridhar Seshasayee <sseshasa@redhat.com>
Thu, 12 Feb 2026 20:03:25 +0000 (01:33 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 23 Feb 2026 07:13:16 +0000 (12:43 +0530)
commit8177e48e5c800e8bdcebd46fcaa51fbe5ea126cc
tree4e5cb4f239856b68013d5491e97a2d28ecf9ed13
parentc63b188a9fb1431827b2299c5dfa2074c078854a
mgr/DaemonServer: Re-order OSDs in crush bucket to maximize OSDs for upgrade

DaemonServer::_maximize_ok_to_upgrade_set() attempts to find which OSDs
from the initial set found as part of _populate_crush_bucket_osds() can be
upgraded as part of the initial phase. If the initial set results in failure,
the convergence logic trims the 'to_upgrade' vector from the end until a safe
set is found.

Therefore, it would be advantageous to sort the OSDs by the ascending number
of PGs hosted by the OSDs. By placing OSDs with smallest (or no PGs) at the
beginning of the vector, the trim logic along with _check_offlines_pgs() will
have the best chance of finding OSDs to upgrade as it approaches a grouping
of OSDs that have the smallest or no PGs.

To achieve the above, a temporary vector of struct pgs_per_osd is created and
sorted for a given crush bucket. The sorted OSDs are pushed to the main
crush_bucket_osds that is eventually used to run the _check_offlines_pgs()
logic to find a safe set of OSDs to upgrade.

pgmap is passed to _populate_crush_bucket_osds() to utilize get_num_pg_by_osd()
for the above logic to work.

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
src/mgr/DaemonServer.cc
src/mgr/DaemonServer.h