From d7ea56f3df956bf728d6f547bbf96b37291eea3c Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 26 Sep 2019 11:02:56 +0800 Subject: [PATCH] mgr/balancer: upmap_max_iterations -> upmap_max_optimizations 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 --- PendingReleaseNotes | 3 +++ src/pybind/mgr/balancer/module.py | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index b73b8e3c73bd1..b387cbf5dc216 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -153,3 +153,6 @@ 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. diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 758aadd5721d0..7ec02e3b8596a 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -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, ' \ -- 2.39.5