]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/devicehealth: do not scrape mon devices 31446/head
authorSage Weil <sage@redhat.com>
Wed, 6 Nov 2019 21:17:53 +0000 (15:17 -0600)
committerSage Weil <sage@redhat.com>
Wed, 6 Nov 2019 21:17:53 +0000 (15:17 -0600)
Disable this feature for nautilus because the tell mechanism for mons is
not reliable.  It works in master (octopus), so only disable this in
the nautilus branch.

This (hopefully!) avoids problems with a hanging mgr that seem to occur
right when devicehealth is trying to scrape mon devices.

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

index 2e14ca98a941429e6cad6ce3fe7f2caeed9855b7..c277dde74ee38c0e32b0b523ac21c400c5fec974 100644 (file)
@@ -310,6 +310,8 @@ class Module(MgrModule):
 
     def scrape_daemon(self, daemon_type, daemon_id):
         ioctx = self.open_connection()
+        if daemon_type != 'osd':
+            return -errno.EINVAL, '', 'scraping non-OSDs not currently supported'
         raw_smart_data = self.do_scrape_daemon(daemon_type, daemon_id)
         if raw_smart_data:
             for device, raw_data in raw_smart_data.items():
@@ -326,9 +328,6 @@ class Module(MgrModule):
         ids = []
         for osd in osdmap['osds']:
             ids.append(('osd', str(osd['osd'])))
-        monmap = self.get("mon_map")
-        for mon in monmap['mons']:
-            ids.append(('mon', mon['name']))
         for daemon_type, daemon_id in ids:
             raw_smart_data = self.do_scrape_daemon(daemon_type, daemon_id)
             if not raw_smart_data:
@@ -347,10 +346,10 @@ class Module(MgrModule):
         r = self.get("device " + devid)
         if not r or 'device' not in r.keys():
             return -errno.ENOENT, '', 'device ' + devid + ' not found'
-        daemons = r['device'].get('daemons', [])
+        daemons = [d for d in r['device'].get('daemons', []) if not d.startswith('osd.')]
         if not daemons:
             return (-errno.EAGAIN, '',
-                    'device ' + devid + ' not claimed by any active daemons')
+                    'device ' + devid + ' not claimed by any active OSD daemons')
         (daemon_type, daemon_id) = daemons[0].split('.')
         ioctx = self.open_connection()
         raw_smart_data = self.do_scrape_daemon(daemon_type, daemon_id,