From: Sage Weil Date: Tue, 28 Jan 2020 16:09:57 +0000 (-0600) Subject: mgr/cephadm: fix detection of just-created OSDs X-Git-Tag: v15.1.1~612^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b44f1651070fb57a9cf95fb1c8aca365fe3881b7;p=ceph.git mgr/cephadm: fix detection of just-created OSDs 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 # Conflicts: # src/pybind/mgr/cephadm/module.py --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index b42f3ee2626..d2346511d91 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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