99from cephadm .serve import CephadmServe
1010from cephadm .services .cephadmservice import CephadmDaemonDeploySpec
1111from cephadm .utils import ceph_release_to_major , name_to_config_section , CEPH_UPGRADE_ORDER , \
12- CEPH_TYPES , NON_CEPH_IMAGE_TYPES , GATEWAY_TYPES
12+ CEPH_TYPES , CEPH_IMAGE_TYPES , NON_CEPH_IMAGE_TYPES , MONITORING_STACK_TYPES , GATEWAY_TYPES
1313from cephadm .ssh import HostConnectionError
1414from orchestrator import OrchestratorError , DaemonDescription , DaemonDescriptionStatus , daemon_type_to_service
1515
@@ -1199,8 +1199,10 @@ def _do_upgrade(self):
11991199 upgraded_daemon_count += done
12001200 self ._update_upgrade_progress (upgraded_daemon_count / len (daemons ))
12011201
1202- # make sure mgr and non-ceph-image daemons are properly redeployed in staggered upgrade scenarios
1203- if daemon_type == 'mgr' or daemon_type in NON_CEPH_IMAGE_TYPES :
1202+ # make sure mgr and monitoring stack daemons are properly redeployed in staggered upgrade scenarios
1203+ # The idea here is to upgrade the mointoring daemons after the mgr is done upgrading as
1204+ # that means cephadm and the dashboard modules themselves have been upgraded
1205+ if daemon_type == 'mgr' or daemon_type in MONITORING_STACK_TYPES :
12041206 if any (d in target_digests for d in self .mgr .get_active_mgr_digests ()):
12051207 need_upgrade_names = [d [0 ].name () for d in need_upgrade ] + \
12061208 [d [0 ].name () for d in need_upgrade_deployer ]
@@ -1214,6 +1216,20 @@ def _do_upgrade(self):
12141216 else :
12151217 # no point in trying to redeploy with new version if active mgr is not on the new version
12161218 need_upgrade_deployer = []
1219+ elif daemon_type in NON_CEPH_IMAGE_TYPES :
1220+ # Also handle daemons that are not on the ceph image but aren't monitoring daemons.
1221+ # This needs to be handled differently than the monitoring daemons as the nvmeof daemon,
1222+ # which falls in this category, relies on the mons being upgraded as well. This block
1223+ # sets these daemon types to be upgraded only when all ceph image daemons have been upgraded
1224+ if any (d in target_digests for d in self .mgr .get_active_mgr_digests ()):
1225+ ceph_daemons = [d for d in self .mgr .cache .get_daemons () if d .daemon_type in CEPH_IMAGE_TYPES ]
1226+ _ , n1 , n2 , __ = self ._detect_need_upgrade (ceph_daemons , target_digests , target_image )
1227+ if not n1 and not n2 :
1228+ # no ceph daemons need upgrade
1229+ dds = [d for d in self .mgr .cache .get_daemons_by_type (
1230+ daemon_type ) if d .name () not in need_upgrade_names ]
1231+ _ , ___ , n2 , ____ = self ._detect_need_upgrade (dds , target_digests , target_image )
1232+ need_upgrade_deployer += n2
12171233
12181234 if any (d in target_digests for d in self .mgr .get_active_mgr_digests ()):
12191235 # only after the mgr itself is upgraded can we expect daemons to have
0 commit comments