]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/DaemonServer: Aggregate and globally sort OSDs for ok-to-upgrade 69366/head
authorSridhar Seshasayee <sridhar.seshasayee@ibm.com>
Wed, 6 May 2026 15:11:33 +0000 (20:41 +0530)
committerSridhar Seshasayee <sridhar.seshasayee@ibm.com>
Thu, 11 Jun 2026 12:12:59 +0000 (17:42 +0530)
commit6761549c5a719f541a850f243318a1212b76c0a6
tree1924094a03120c75045d9d2c7a8b3d2dd48974c3
parent95abe0e3363832efeede0c6bd8e934cd487d9025
mgr/DaemonServer: Aggregate and globally sort OSDs for ok-to-upgrade

The 'ok-to-upgrade' command output sorting did not scale accurately
when target CRUSH buckets contained multiple child buckets (e.g., a
chassis containing multiple hosts). OSDs were previously sorted
individually per child bucket and appended sequentially. This created
fragmented, per-host sort segments rather than a globally sorted list
for the parent bucket.

Changes:

1. Fix the issue above by aggregating all child OSDs into a single vector prior
to executing a single, global sort operation based on PG counts. Additionally,
optimize memory efficiency and future-proof the logic by reserving continuous
vector blocks to avoid dynamic heap reallocations.

2. Add integration tests with chassis and rack based CRUSH hierarchies which
verifies the ok-to-upgrade functionality. In addition, the tests crucially
verify the order of OSDs returned is according to the ascending order of
acting PG count. Additionally, make minor fix-ups to lines that determine the
length of a list in JSON response by removing the redundant "| bc".

Fixes: https://tracker.ceph.com/issues/77272
Signed-off-by: Sridhar Seshasayee <sridhar.seshasayee@ibm.com>
qa/standalone/misc/ok-to-upgrade.sh
src/mgr/DaemonServer.cc