]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/balancer: identify roots that osds overlap in 21427/head
authorSage Weil <sage@redhat.com>
Fri, 13 Apr 2018 22:52:24 +0000 (17:52 -0500)
committerSage Weil <sage@redhat.com>
Fri, 13 Apr 2018 22:52:24 +0000 (17:52 -0500)
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 <sage@redhat.com>
src/pybind/mgr/balancer/module.py

index 807c521f6212fc406817071bc6331cdf941703a9..289fc127d83b9382d4bc358c2045a3eef7a03ec5 100644 (file)
@@ -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