]>
Commit | Line | Data |
---|---|---|
529a05d2 TL |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Sage Weil <sage@redhat.com> | |
3 | Date: Wed, 6 Nov 2019 15:17:53 -0600 | |
4 | Subject: [PATCH] mgr/devicehealth: do not scrape mon devices | |
5 | ||
6 | Disable this feature for nautilus because the tell mechanism for mons is | |
7 | not reliable. It works in master (octopus), so only disable this in | |
8 | the nautilus branch. | |
9 | ||
10 | This (hopefully!) avoids problems with a hanging mgr that seem to occur | |
11 | right when devicehealth is trying to scrape mon devices. | |
12 | ||
13 | Signed-off-by: Sage Weil <sage@redhat.com> | |
14 | (cherry picked from commit d592e56e74d94c6a05b9240fcb0031868acefbab) | |
15 | Signed-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 | ||
20 | diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py | |
21 | index 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, |