]> git.proxmox.com Git - ceph.git/blame - patches/0013-mgr-devicehealth-do-not-scrape-mon-devices.patch
import ceph 14.2.5
[ceph.git] / patches / 0013-mgr-devicehealth-do-not-scrape-mon-devices.patch
CommitLineData
529a05d2
TL
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Sage Weil <sage@redhat.com>
3Date: Wed, 6 Nov 2019 15:17:53 -0600
4Subject: [PATCH] mgr/devicehealth: do not scrape mon devices
5
6Disable this feature for nautilus because the tell mechanism for mons is
7not reliable. It works in master (octopus), so only disable this in
8the nautilus branch.
9
10This (hopefully!) avoids problems with a hanging mgr that seem to occur
11right when devicehealth is trying to scrape mon devices.
12
13Signed-off-by: Sage Weil <sage@redhat.com>
14(cherry picked from commit d592e56e74d94c6a05b9240fcb0031868acefbab)
15Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16---
17 src/pybind/mgr/devicehealth/module.py | 9 ++++-----
18 1 file changed, 4 insertions(+), 5 deletions(-)
19
20diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py
21index 2e14ca98a9..c277dde74e 100644
22--- a/src/pybind/mgr/devicehealth/module.py
23+++ b/src/pybind/mgr/devicehealth/module.py
24@@ -310,6 +310,8 @@ class Module(MgrModule):
25
26 def scrape_daemon(self, daemon_type, daemon_id):
27 ioctx = self.open_connection()
28+ if daemon_type != 'osd':
29+ return -errno.EINVAL, '', 'scraping non-OSDs not currently supported'
30 raw_smart_data = self.do_scrape_daemon(daemon_type, daemon_id)
31 if raw_smart_data:
32 for device, raw_data in raw_smart_data.items():
33@@ -326,9 +328,6 @@ class Module(MgrModule):
34 ids = []
35 for osd in osdmap['osds']:
36 ids.append(('osd', str(osd['osd'])))
37- monmap = self.get("mon_map")
38- for mon in monmap['mons']:
39- ids.append(('mon', mon['name']))
40 for daemon_type, daemon_id in ids:
41 raw_smart_data = self.do_scrape_daemon(daemon_type, daemon_id)
42 if not raw_smart_data:
43@@ -347,10 +346,10 @@ class Module(MgrModule):
44 r = self.get("device " + devid)
45 if not r or 'device' not in r.keys():
46 return -errno.ENOENT, '', 'device ' + devid + ' not found'
47- daemons = r['device'].get('daemons', [])
48+ daemons = [d for d in r['device'].get('daemons', []) if not d.startswith('osd.')]
49 if not daemons:
50 return (-errno.EAGAIN, '',
51- 'device ' + devid + ' not claimed by any active daemons')
52+ 'device ' + devid + ' not claimed by any active OSD daemons')
53 (daemon_type, daemon_id) = daemons[0].split('.')
54 ioctx = self.open_connection()
55 raw_smart_data = self.do_scrape_daemon(daemon_type, daemon_id,