Bug #75681
closed[osd upgrade] ok-to-upgrade does not honour the specified max requested upgradable OSDs
100%
Description
The ok-to-upgrade should return only the specified max number OSDs. the bug is that it returns more than the required OSDs. Ideally the command should provide maximum OSDs limited by ”max” OSDs within the specified crush_bucket.
The following tests are for a setup with more than 16 OSDs.
[ceph: root@ceph-node-0 /]# ceph osd ok-to-upgrade --crush_bucket ceph-node-1 --ceph_version 20.3.0-5843-g82e79171 --max 4
{"ok_to_upgrade":true,"all_osds_upgraded":false,"osds_in_crush_bucket":[0,2,4,7,9,11,15,17,19,21,23,25,27,29,31,33,13],"osds_ok_to_upgrade":[0,2,4,7,9,11,15,17,19,21,23,25,27,29,31,33,13],"osds_upgraded":[],"bad_no_version":[]}
[ceph: root@ceph-node-0 /]# ceph osd ok-to-upgrade --crush_bucket ceph-node-1 --ceph_version 20.3.0-5843-g82e79171
{"ok_to_upgrade":true,"all_osds_upgraded":false,"osds_in_crush_bucket":[0,2,4,7,9,11,15,17,19,21,23,25,27,29,31,33,13],"osds_ok_to_upgrade":[0,2,4,7,9,11,15,17,19,21,23,25,27,29,31,33,13],"osds_upgraded":[],"bad_no_version":[]}
[ceph: root@ceph-node-0 /]# ceph version
ceph version 20.3.0-5843-g82e79171 (82e791713c4862f9eead667e9df1e90728255bae) tentacle (dev - RelWithDebInfo)
SS Updated by Sridhar Seshasayee 8 months ago
- Project changed from Ceph to RADOS
- Category deleted (
OSD) - Status changed from New to Triaged
- Assignee set to Sridhar Seshasayee
The reason that the command in some cases return more than the 'max' specified OSDs is that ‘ok-to-upgrade’ command works in two phases:
Phase 1 : Checks if all OSDs in the specified crush bucket can be brought offline safely. If so, and even if it exceeds the specified ‘max’ parameter,
the command returns all the OSDs found in this phase. This is because the command attempts to maximize the upgrade set in phase1. If ‘max’ is
exceeded, the command terminates at this point and doesn’t move to phase2.
Phase 2 : If OSDs found in phase1 is lesser than ‘max’, phase2 attempts to find more OSDs either within the crush bucket or across the crush hierarchy.
Based on your comments regarding deterministic behaviour with both ‘--crush_bucket’ and ‘--max’ parameters, phase 2 I described above seems unnecessary.
By running phase 1 alone (eliminating phase 2) and ensuring only up to ‘max’ OSDs (if found) are returned, the requirements will be met.
Simplifying the logic by limiting the 'max' returned OSDs to within the specified crush also makes sense from a user/orchestrator perspective.
It may involve more cycles to complete the upgrade but ensures that,
- upgrades are performed per crush bucket
- simplifies logic to orchestrate the upgrade.
I will post a PR for this soon.
SS Updated by Sridhar Seshasayee 8 months ago
- Status changed from Triaged to In Progress
SS Updated by Sridhar Seshasayee 8 months ago
- Status changed from In Progress to Fix Under Review
- Pull request ID set to 68048
The changes in the associated PR also addresses https://tracker.ceph.com/issues/75548.
SS Updated by Sridhar Seshasayee 8 months ago
- Subtask #75548 added
LF Updated by Laura Flores 8 months ago
Scrub note: PR under review
LF Updated by Laura Flores 8 months ago
Needs review from @Radoslaw Zarzynski and @Kamoltat (Junior) Sirivadhna
SS Updated by Sridhar Seshasayee 8 months ago
- Status changed from Fix Under Review to Resolved
- Backport set to tentacle
UB Updated by Upkeep Bot 8 months ago
- Merge Commit set to acab6731d43164f8a3de9f955acbb71aa27e60bb
- Fixed In set to v21.0.0-429-gacab6731d4
- Upkeep Timestamp set to 2026-04-13T09:46:16+00:00
SS Updated by Sridhar Seshasayee 8 months ago
- Status changed from Resolved to Pending Backport
UB Updated by Upkeep Bot 8 months ago
- Copied to Backport #75981: tentacle: [osd upgrade] ok-to-upgrade does not honour the specified max requested upgradable OSDs added
UB Updated by Upkeep Bot 8 months ago
- Tags (freeform) set to backport_processed
SS Updated by Sridhar Seshasayee 8 months ago
- Status changed from Pending Backport to Resolved
UB Updated by Upkeep Bot 3 months ago
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-04-13T09:46:16+00:00 to 2026-08-28T01:41:25+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~810
- Upkeep Timestamp changed from 2026-08-28T01:41:25+00:00 to 2026-10-24T02:01:44+00:00