]> 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 66948/head
authorSridhar Seshasayee <sseshasa@redhat.com>
Thu, 12 Feb 2026 20:03:25 +0000 (01:33 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Tue, 24 Feb 2026 02:42:20 +0000 (08:12 +0530)
commitf5b7e3e6dfe20e7d6a357094997fdd56094bb8aa
treea917143622aa89cf536e8ea71f8f413bcf139013
parent947230399a8131b8d0424b2856aea158eb5f2150
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>
(cherry picked from commit 8177e48e5c800e8bdcebd46fcaa51fbe5ea126cc)
src/mgr/DaemonServer.cc
src/mgr/DaemonServer.h