]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: fix upgrade order 33811/head
authorSage Weil <sage@redhat.com>
Mon, 9 Mar 2020 01:38:59 +0000 (20:38 -0500)
committerSage Weil <sage@redhat.com>
Mon, 9 Mar 2020 23:23:14 +0000 (18:23 -0500)
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 <sage@redhat.com>
src/pybind/mgr/cephadm/module.py

index 37f9c28edbb5d1a04a5ceab33f7561919d595adc..a3df247c4e31c5ddad8f66a7505e0d13400d70fe 100644 (file)
@@ -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',