From: Sage Weil Date: Mon, 9 Mar 2020 01:38:59 +0000 (-0500) Subject: mgr/cephadm: fix upgrade order X-Git-Tag: v15.1.1~54^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5dea5ae123a7482f4b2b915b3df9484602c71a89;p=ceph.git mgr/cephadm: fix upgrade order Create two variables, CEPH_TYPES and CEPH_UPGRADE_ORDER. In reality they are both the same, but this way the meaning is clear, and they lists won't get out of sync (they should always have the same elements). Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 37f9c28edbb5..a3df247c4e31 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -65,6 +65,12 @@ DATEFMT = '%Y-%m-%dT%H:%M:%S.%f' HOST_CACHE_PREFIX = "host." SPEC_STORE_PREFIX = "spec." +# ceph daemon types that use the ceph container image. +# NOTE: listed in upgrade order! +CEPH_UPGRADE_ORDER = ['mgr', 'mon', 'crash', 'osd', 'mds', 'rgw', 'rbd-mirror'] +CEPH_TYPES = set(CEPH_UPGRADE_ORDER) + + # for py2 compat try: from tempfile import TemporaryDirectory # py3 @@ -86,12 +92,6 @@ except ImportError: self.cleanup() -# high-level TODO: -# - bring over some of the protections from ceph-deploy that guard against -# multiple bootstrapping / initialization - -CEPH_TYPES = ['mon', 'mgr', 'osd', 'mds', 'rbd-mirror', 'rgw', 'crash'] - def name_to_config_section(name): """ Map from daemon names to ceph entity names (as seen in config) @@ -792,7 +792,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): daemons = self.cache.get_daemons() done = 0 - for daemon_type in CEPH_TYPES: + for daemon_type in CEPH_UPGRADE_ORDER: self.log.info('Upgrade: Checking %s daemons...' % daemon_type) need_upgrade_self = False for d in daemons: @@ -942,7 +942,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): 'value': target_name, 'who': 'global', }) - for daemon_type in CEPH_TYPES: + for daemon_type in CEPH_UPGRADE_ORDER: ret, image, err = self.mon_command({ 'prefix': 'config rm', 'name': 'container_image',