]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: fix detection of just-created OSDs
authorSage Weil <sage@redhat.com>
Tue, 28 Jan 2020 16:09:57 +0000 (10:09 -0600)
committerSage Weil <sage@redhat.com>
Tue, 28 Jan 2020 16:09:57 +0000 (10:09 -0600)
Only match OSDs we see that didn't exist before we ran c-v prepare.
This might include other OSDs created by a racing c-v incantation, but (1)
we shouldn't have any of those, and (2) even if they were, the OSD is new
and should be added.

Signed-off-by: Sage Weil <sage@redhat.com>
# Conflicts:
# src/pybind/mgr/cephadm/module.py

src/pybind/mgr/cephadm/module.py

index b42f3ee26260058759c7e9c5741144898fc247f6..d2346511d9128bf6ad590d85d5731f7cbdb119ce 100644 (file)
@@ -1355,6 +1355,8 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin):
             'keyring': keyring,
         })
 
+        before_osd_uuid_map = self.get_osd_uuid_map()
+
         split_cmd = cmd.split(' ')
         _cmd = ['--config-and-keyring', '-', '--']
         _cmd.extend(split_cmd)
@@ -1381,6 +1383,9 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin):
                 if osd['tags']['ceph.cluster_fsid'] != fsid:
                     self.log.debug('mismatched fsid, skipping %s' % osd)
                     continue
+                if osd_id in before_osd_uuid_map:
+                    # this osd existed before we ran prepare
+                    continue
                 if osd_id not in osd_uuid_map:
                     self.log.debug('osd id %d does not exist in cluster' % osd_id)
                     continue