]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/balancer: fix sanity check against minimal pg numbers per pool
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 30 Jan 2018 08:58:33 +0000 (16:58 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 8 Feb 2018 05:39:14 +0000 (13:39 +0800)
And rename some variables properly.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit cdae240ed9bd667c13a3afdebc25eb3649ce3503)

src/pybind/mgr/balancer/module.py

index cd63b53a7100d4435300d383cf441a933fe7b7e4..f21805ba0e17cde787d87f5ca4636e3db041cefe 100644 (file)
@@ -711,12 +711,14 @@ class Module(MgrModule):
             random.shuffle(roots)
             for root in roots:
                 pools = best_pe.root_pools[root]
-                pgs = len(best_pe.target_by_root[root])
-                min_pgs = pgs * min_pg_per_osd
-                if best_pe.total_by_root[root] < min_pgs:
+                osds = len(best_pe.target_by_root[root])
+                min_pgs = osds * min_pg_per_osd
+                if best_pe.total_by_root[root][key] < min_pgs:
                     self.log.info('Skipping root %s (pools %s), total pgs %d '
                                   '< minimum %d (%d per osd)',
-                                  root, pools, pgs, min_pgs, min_pg_per_osd)
+                                  root, pools,
+                                  best_pe.total_by_root[root][key],
+                                  min_pgs, min_pg_per_osd)
                     continue
                 self.log.info('Balancing root %s (pools %s) by %s' %
                               (root, pools, key))