]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/balancer: upmap_max_iterations -> upmap_max_optimizations
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 26 Sep 2019 03:02:56 +0000 (11:02 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 28 Sep 2019 00:31:45 +0000 (08:31 +0800)
With osd_calc_pg_upmaps_aggressively on we might have to iterate
hundreds or thousands of times to figure out an optimization,
but upmap_max_optimizations will remain a hard limit for the
total optimizations that can be returned.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
PendingReleaseNotes
src/pybind/mgr/balancer/module.py

index b73b8e3c73bd138c5f883cdf8d0f03ae69ed6cba..b387cbf5dc216de7a0386e1a8e9f7297edcdbe0d 100644 (file)
   number of PGs.  To change this behavior, or to learn more about PG
   autoscaling, see :ref:`pg-autoscaler`.  Note that existing pools in
   upgraded clusters will still be set to ``warn`` by default.
+
+* The ``upmap_max_iterations`` config option of mgr/balancer has been
+  renamed to ``upmap_max_optimizations`` to better match its behaviour.
index 758aadd5721d0cc016f2ed68ee26041c1acfb6bd..7ec02e3b8596a21c03ec3ff1ee65a19cb8f8d0f9 100644 (file)
@@ -294,10 +294,10 @@ class Module(MgrModule):
             'runtime': True,
         },
         {
-            'name': 'upmap_max_iterations',
+            'name': 'upmap_max_optimizations',
             'type': 'uint',
             'default': 10,
-            'desc': 'maximum upmap optimization iterations',
+            'desc': 'maximum upmap optimizations to make per attempt',
             'runtime': True,
         },
         {
@@ -905,7 +905,7 @@ class Module(MgrModule):
 
     def do_upmap(self, plan):
         self.log.info('do_upmap')
-        max_iterations = self.get_module_option('upmap_max_iterations')
+        max_optimizations = self.get_module_option('upmap_max_optimizations')
         max_deviation = self.get_module_option('upmap_max_deviation')
 
         ms = plan.initial
@@ -920,7 +920,7 @@ class Module(MgrModule):
 
         inc = plan.inc
         total_did = 0
-        left = max_iterations
+        left = max_optimizations
         osdmap_dump = self.get_osdmap().dump()
         pools_with_pg_merge = [p['pool_name'] for p in osdmap_dump.get('pools', [])
                                if p['pg_num'] > p['pg_num_target']]
@@ -946,7 +946,7 @@ class Module(MgrModule):
             left -= did
             if left <= 0:
                 break
-        self.log.info('prepared %d/%d changes' % (total_did, max_iterations))
+        self.log.info('prepared %d/%d changes' % (total_did, max_optimizations))
         if total_did == 0:
             return -errno.EALREADY, 'Unable to find further optimization, ' \
                                     'or pool(s)\' pg_num is decreasing, ' \