From 05a94472463e3b39f588022810fcc89eb47acfab Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 13 Apr 2018 17:52:24 -0500 Subject: [PATCH] mgr/balancer: identify roots that osds overlap in This error message isn't very informative; tell the user which osds appear in mulitple roots, and which roots those are! Signed-off-by: Sage Weil --- src/pybind/mgr/balancer/module.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 807c521f6212f..289fc127d83b9 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -747,11 +747,13 @@ class Module(MgrModule): for root, wm in pe.target_by_root.iteritems(): for osd in wm.iterkeys(): if osd in visited: - overlap[osd] = 1 - visited[osd] = 1 + if osd not in overlap: + overlap[osd] = [ visited[osd] ] + overlap[osd].append(root) + visited[osd] = root if len(overlap) > 0: detail = 'Some osds belong to multiple subtrees: %s' % \ - overlap.keys() + overlap self.log.error(detail) return -errno.EOPNOTSUPP, detail -- 2.39.5