Project

General

Profile

Actions

Bug #75548

closed
VM SS

Bug #75681: [osd upgrade] ok-to-upgrade does not honour the specified max requested upgradable OSDs

[osd ok-to-upgrade] When few of the OSDs are upgraded in the cluster, the upgraded OSDs are part of osds_ok_to_upgrade list in `ceph osd ok-to-upgrade command`

Bug #75548: [osd ok-to-upgrade] When few of the OSDs are upgraded in the cluster, the upgraded OSDs are part of osds_ok_to_upgrade list in `ceph osd ok-to-upgrade command`

Added by Vipin M S 9 months ago. Updated 8 months ago.

Status:
Won't Fix
Priority:
Normal
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Q/A
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
OSD
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Description of problem - Provide a detailed description of the issue encountered, including logs/command-output snippets and screenshots if the issue:

When few of the OSDs are upgraded to the target version in the cluster. The already upgraded OSDs are being added as a part of osds_ok_to_upgrade. ceph osd metadata and debug_mgr 20 logs are added as an attachment.

High level steps :-
(1) Deploy Ceph cluster with crush hierarchy consisting of rack, chassis and host.
(2) Upgrade mgr, crash, mon to the latest version
(3) Upgrade the OSDs of host ceph-vipin-automation-svckwe-node1-installer - osd.0 , osd.10 and osd.16 to the latest version.
(4) Run osd ok-to-upgrade command as below
  1. ceph osd ok-to-upgrade rack0 20.3.0-6080-g96ad4784

Test steps with logs:-

(1) Deploy Ceph cluster with below crush hierarchy consisting of rack, chassis and host.

root@ceph-vipin-automation-svckwe-node7 ~]# ceph osd tree
ID   CLASS  WEIGHT   TYPE NAME                                                      STATUS  REWEIGHT  PRI-AFF
 -1         0.35010  root default
-35         0.08752      rack rack0
-19         0.04376          chassis chassis0
 -3         0.04376              host ceph-vipin-automation-svckwe-node1-installer
  0    hdd  0.01459                  osd.0                                              up   1.00000  1.00000
 10    hdd  0.01459                  osd.10                                             up   1.00000  1.00000
 16    hdd  0.01459                  osd.16                                             up   1.00000  1.00000
-27         0.04376          chassis chassis4
 -7         0.04376              host ceph-vipin-automation-svckwe-node5
  5    hdd  0.01459                  osd.5                                              up   1.00000  1.00000
 13    hdd  0.01459                  osd.13                                             up   1.00000  1.00000
 21    hdd  0.01459                  osd.21                                             up   1.00000  1.00000
-37         0.08752      rack rack1
-21         0.04376          chassis chassis1
 -5         0.04376              host ceph-vipin-automation-svckwe-node2
  3    hdd  0.01459                  osd.3                                              up   1.00000  1.00000
 12    hdd  0.01459                  osd.12                                             up   1.00000  1.00000
 19    hdd  0.01459                  osd.19                                             up   1.00000  1.00000
-29         0.04376          chassis chassis5
-11         0.04376              host ceph-vipin-automation-svckwe-node6
  1    hdd  0.01459                  osd.1                                              up   1.00000  1.00000
  9    hdd  0.01459                  osd.9                                              up   1.00000  1.00000
 17    hdd  0.01459                  osd.17                                             up   1.00000  1.00000
-39         0.08752      rack rack2
-23         0.04376          chassis chassis2
-17         0.04376              host ceph-vipin-automation-svckwe-node3
  7    hdd  0.01459                  osd.7                                              up   1.00000  1.00000
 18    hdd  0.01459                  osd.18                                             up   1.00000  1.00000
 23    hdd  0.01459                  osd.23                                             up   1.00000  1.00000
-31         0.04376          chassis chassis6
-15         0.04376              host ceph-vipin-automation-svckwe-node8
  6    hdd  0.01459                  osd.6                                              up   1.00000  1.00000
 14    hdd  0.01459                  osd.14                                             up   1.00000  1.00000
 22    hdd  0.01459                  osd.22                                             up   1.00000  1.00000
-41         0.08752      rack rack3
-25         0.04376          chassis chassis3
-13         0.04376              host ceph-vipin-automation-svckwe-node4
  2    hdd  0.01459                  osd.2                                              up   1.00000  1.00000
  8    hdd  0.01459                  osd.8                                              up   1.00000  1.00000
 15    hdd  0.01459                  osd.15                                             up   1.00000  1.00000
-33         0.04376          chassis chassis7
 -9         0.04376              host ceph-vipin-automation-svckwe-node9
  4    hdd  0.01459                  osd.4                                              up   1.00000  1.00000
 11    hdd  0.01459                  osd.11                                             up   1.00000  1.00000
 20    hdd  0.01459                  osd.20                                             up   1.00000  1.00000

(2) Upgrade mgr, crash, mon to the latest version

ceph orch upgrade start --image quay.ceph.io/ceph-ci/ceph@sha256:1aacf385fc3426c504eab5ac1cb402fc147c0aebb87f71fe803239993318b392 --daemon-types mgr,crash,mon

(3) Upgrade the OSDs of host ceph-vipin-automation-svckwe-node1-installer - osd.0 , osd.10 and osd.16 to the latest version.

ceph orch upgrade start --image quay.ceph.io/ceph-ci/ceph@sha256:1aacf385fc3426c504eab5ac1cb402fc147c0aebb87f71fe803239993318b392 --daemon-types osd --hosts ceph-vipin-automation-svckwe-node1-installer

(4) Run osd ok-to-upgrade command as below

[root@ceph-vipin-automation-svckwe-node7 ~]# ceph osd ok-to-upgrade rack0 20.3.0-6080-g96ad4784 {"ok_to_upgrade":true,"all_osds_upgraded":false,"osds_in_crush_bucket":[16,0,10,13,21,5],"osds_ok_to_upgrade":[13,21,5,16,0,10],"osds_upgraded":[16,0,10],"bad_no_version":[]}
Tue Mar 17 08:58:20 UTC 2026

From the output we can observe, already upgraded OSDs osd.0, osd.16 and osd.10 which are part of the host ceph-vipin-automation-svckwe-node1-installer is being added to the list of osds_ok_to_upgrade

Version-Release number of selected component (if applicable):
[root@ceph-vipin-automation-svckwe-node7 ~]# ceph version
ceph version 20.3.0-6080-g96ad4784 (96ad47845575ccdc0cb6743532a7b10e05aef93e) tentacle (dev - RelWithDebInfo)
Tue Mar 17 09:00:30 UTC 2026

Does this issue impact your ability to continue to work with the product?
No

Is there any workaround available to the best of your knowledge?
No

Can this issue be reproduced? If so, please provide the hit rate
Yes

If this is a regression, please provide more details to justify this:

Actual results:
Already upgraded osds are being added as part of the osds_ok_to_upgrade list

Expected results:
Already upgraded osds should not be added as part of the osds_ok_to_upgrade list

Logs collected and log location:

Additional info:


Files

osd_metadata.log (71.5 KB) osd_metadata.log Vipin M S, 03/17/2026 09:07 AM
bz_few_osds_upgraded.log.zip (898 KB) bz_few_osds_upgraded.log.zip Vipin M S, 03/17/2026 09:07 AM

SS Updated by Sridhar Seshasayee 9 months ago Actions #1

  • Assignee set to Sridhar Seshasayee

SS Updated by Sridhar Seshasayee 9 months ago Actions #2

  • Status changed from New to In Progress

The issue is root caused.

The OSDs already upgraded are erroneously included in the ok-to-upgrade set during
the phase 2 that explores OSDs in additional crush buckets. During this phase the
logic comes across OSDs that are already upgraded which is expected but fails to
determine that the OSD are already upgraded. The fix is to include additional
logic in phase 2 to do the following:
1. Look for upgraded OSDs within the existing 'upgraded' set
2. If the OSD is not found in the 'upgraded' set. determine the Ceph version
of the OSD by reading its metadata. Depending on the version, the OSD
is either ignored or considered.

I am working on a fix and will prepare a PR for this soon.

Logs below show the phase where OSDs 16, 0 and 10 are erroneously included in
the ok-to-upgrade set:

...
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _maximize_ok_to_upgrade_set found 3 OSDs that are safe to upgrade
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _maximize_ok_to_upgrade_set Trying to add more children...
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _populate_crush_bucket_osds bucket type of parent ceph-vipin-automation-svckwe-node5 is host
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _populate_crush_bucket_osds picked osds: 5,13,21 from bucket: ceph-vipin-automation-svckwe-node5
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _populate_crush_bucket_osds bucket type of parent chassis4 is chassis
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _populate_crush_bucket_osds picked osds: 5,13,21 from bucket: ceph-vipin-automation-svckwe-node5
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _populate_crush_bucket_osds bucket type of parent rack0 is rack
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _populate_crush_bucket_osds picked osds: 0,10,16 from bucket: chassis0
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _populate_crush_bucket_osds picked osds: 5,13,21 from bucket: chassis4
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _check_offlines_pgs [13,21,5,16] -> 159 ok, 0 not ok, 0 unknown
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _check_offlines_pgs [13,21,5,16,0] -> 193 ok, 0 not ok, 0 unknown
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _check_offlines_pgs [13,21,5,16,0,10] -> 241 ok, 0 not ok, 0 unknown
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _maximize_ok_to_upgrade_set  hit max
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server _maximize_ok_to_upgrade_set found 3 additional OSD(s) to upgrade
2026-03-17T08:58:20.775+0000 7f704d036640 20 mgr.server reply success

SS Updated by Sridhar Seshasayee 9 months ago Actions #3

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 67861

SS Updated by Sridhar Seshasayee 8 months ago Actions #4

  • Parent task set to #75681
  • Pull request ID deleted (67861)

The changes associated with tracker https://tracker.ceph.com/issues/75681
addresses this issue and therefore I am setting it as the parent tracker
of this one.

SS Updated by Sridhar Seshasayee 8 months ago Actions #5

  • Status changed from Fix Under Review to Won't Fix

Marking this as 'won't fix' as there's no separate fix needed for this tracker.
The changes associated with the parent tracker addresses this issue as well.

Actions

Also available in: PDF Atom