]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/DaemonServer: Aggregate and globally sort OSDs for ok-to-upgrade 69542/head
authorSridhar Seshasayee <sridhar.seshasayee@ibm.com>
Wed, 6 May 2026 15:11:33 +0000 (20:41 +0530)
committerSridhar Seshasayee <sridhar.seshasayee@ibm.com>
Wed, 17 Jun 2026 10:47:07 +0000 (16:17 +0530)
commit3e17241f1e2cf79378e4778ef01f49c8d108710c
treedc088797c281c1f3cf82beb444b5ccfb09beb749
parent2cc1b1302259e8f3cf00c5979068acd39cbd0048
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>
(cherry picked from commit 6761549c5a719f541a850f243318a1212b76c0a6)
qa/standalone/misc/ok-to-upgrade.sh
src/mgr/DaemonServer.cc