Skip to content

mgr/cephadm: Incorporate separate Mon error codes for validations - #74240

Open
ashjosh1git wants to merge 1 commit into
ceph:mainfrom
ashjosh1git:ceph-tracker-83429-mon-ok-to-upg-err-code
Open

ashjosh1git wants to merge 1 commit into
ceph:mainfrom
ashjosh1git:ceph-tracker-83429-mon-ok-to-upg-err-code

Conversation

@ashjosh1git

@ashjosh1git ashjosh1git commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

With #74085 Mon now returns the following error codes for ok-to-upgrade command:

  • Bad version string - EINVAL (as before)
  • Bucket type not usable - ENOTSUP (new)
  • Unknown bucket, no children, no OSDs - ENOENT (as before)

This PR incorporates the new code. Added tests that cover the scenarios for the following CLI invocations.

Unit tests are done with a sandbox build with #74085 build.

Tests need to be run with #74085 code.

[ceph: root@ceph-node-0 /]# ceph osd ok-to-upgrade default "20.2.5-0-ged27c686"                                                                                                              
Error ENOTSUP: crush bucket "default" of type "root" is incompatible for upgradability check; valid types are: 'rack', 'chassis', 'host' and 'osd'                                                                                                                                    
[ceph: root@ceph-node-0 /]# ceph osd ok-to-upgrade default "20.2.5-0"                                                                                                                        
Error EINVAL: Invalid Ceph version (short) format. The format to use is the same as 'ceph_version_short' found in OSD metadata. Examples: "20.3.0-3803-g63ca1ffb5a2", "20.1.0-144.el9cp".    
[ceph: root@ceph-node-0 /]# ceph osd ok-to-upgrade ceph-node-0 "20.2.5-0-ged27c686"                                                                                                          
{"ok_to_upgrade":true,"all_osds_upgraded":false,"osds_in_crush_bucket":[0],"osds_ok_to_upgrade":[0],"osds_upgraded":[],"bad_no_version":[]}  

Fixes: https://tracker.ceph.com/issues/83429

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The recovery message incorrectly lists osd as a supported upgrade bucket type, directing operators to an option that cephadm validation rejects.

1 open issue
What changed in this PR

Updates cephadm’s OSD upgrade handling to use the distinct ok-to-upgrade error codes introduced by #74085, separating unsupported bucket types from invalid arguments.

Changes:

  • Adds dedicated health errors and pauses upgrades for ENOTSUP and EINVAL.
  • Tightens error-code matching so ENOENT does not match EINVAL.
  • Adds unit tests for unsupported bucket types and malformed version strings.
File Description
src/​pybind/​mgr/​cephadm/​upgrade.py Distinguishes validation failures and reports dedicated upgrade errors.
src/​pybind/​mgr/​cephadm/​tests/​test_upgrade.py Tests upgrade pauses and health errors for the new cases.

Review effort: Balanced

Comment thread src/pybind/mgr/cephadm/upgrade.py Resolved
With PR 74085 Mon now returns the following error codes for ok-to-upgrade command:
Bad version string	- EINVAL (as before)
Bucket type not usable	- ENOTSUP (change)
Unknown bucket, no children, no OSDs - ENOENT (as before)

This PR incorporates those codes.

Fixes: https://tracker.ceph.com/issues/83429
Signed-off-by: Ashwin M. Joshi <[email protected]>
@ashjosh1git
ashjosh1git force-pushed the ceph-tracker-83429-mon-ok-to-upg-err-code branch from fb53341 to 9ff4677 Compare November 24, 2026 10:07
@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath37-testing-20261124.044935-main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants