]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Partially revert "mgr/balancer: balance pools with same crush_rule in batch"
authorDavid Zafman <dzafman@redhat.com>
Fri, 13 Dec 2019 03:42:10 +0000 (19:42 -0800)
committerDavid Zafman <dzafman@redhat.com>
Wed, 15 Jan 2020 21:23:53 +0000 (21:23 +0000)
This partially reverts commit 3a730d751deff892e7a0bddba87eba3dbb829c3e

Fixes: https://tracker.ceph.com/issues/43307
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 7a1d6872c74a03b2493ecef0f2c4a5f9656a7c5e)

Conflicts:
src/pybind/mgr/balancer/module.py (No active+clean handling)

src/pybind/mgr/balancer/module.py

index ca9cb7a609082b3cacbd18659e6bedb14cfa56ab..2688bebf71515f2f41686d66bef2cd0004979cb5 100644 (file)
@@ -947,7 +947,11 @@ class Module(MgrModule):
             detail = 'No pools available'
             self.log.info(detail)
             return -errno.ENOENT, detail
+        # shuffle pool list so they all get equal (in)attention
+        random.shuffle(pools)
+        self.log.info('pools %s' % pools)
 
+        adjusted_pools = []
         inc = plan.inc
         total_did = 0
         left = max_iterations
@@ -955,7 +959,6 @@ class Module(MgrModule):
         pools_with_pg_merge = [p['pool_name'] for p in osdmap_dump.get('pools', [])
                                if p['pg_num'] > p['pg_num_target']]
         crush_rule_by_pool_name = dict((p['pool_name'], p['crush_rule']) for p in osdmap_dump.get('pools', []))
-        pools_by_crush_rule = {} # group pools by crush_rule
         for pool in pools:
             if pool not in crush_rule_by_pool_name:
                 self.log.info('pool %s does not exist' % pool)
@@ -963,15 +966,11 @@ class Module(MgrModule):
             if pool in pools_with_pg_merge:
                 self.log.info('pool %s has pending PG(s) for merging, skipping for now' % pool)
                 continue
-            crush_rule = crush_rule_by_pool_name[pool]
-            if crush_rule not in pools_by_crush_rule:
-                pools_by_crush_rule[crush_rule] = []
-            pools_by_crush_rule[crush_rule].append(pool)
-        classified_pools = list(pools_by_crush_rule.values())
+            adjusted_pools.append(pool)
         # shuffle so all pools get equal (in)attention
-        random.shuffle(classified_pools)
-        for it in classified_pools:
-            did = ms.osdmap.calc_pg_upmaps(inc, max_deviation, left, it)
+        random.shuffle(adjusted_pools)
+        for pool in adjusted_pools:
+            did = ms.osdmap.calc_pg_upmaps(inc, max_deviation, left, [pool])
             total_did += did
             left -= did
             if left <= 0: