]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/balancer: mgr/balancer/max_misplaced -> pg_max_misplaced
authorSage Weil <sage@redhat.com>
Wed, 19 Sep 2018 19:35:03 +0000 (14:35 -0500)
committerSage Weil <sage@redhat.com>
Tue, 16 Oct 2018 12:22:48 +0000 (07:22 -0500)
Make this a compiled-in option that is consumed by other components as
well as the balancer.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/options.cc
src/pybind/mgr/balancer/module.py

index e07bf90d171330f5b38e4d395c52cff9893a55f2..d7d892f802df25f10e6f78d4de2ec70cf86d5e4a 100644 (file)
@@ -4974,6 +4974,10 @@ std::vector<Option> get_global_options() {
     Option("debug_asok_assert_abort", Option::TYPE_BOOL, Option::LEVEL_DEV)
     .set_default(false)
     .set_description("allow commands 'assert' and 'abort' via asok for testing crash dumps etc"),
+
+    Option("target_max_misplaced_ratio", Option::TYPE_FLOAT, Option::LEVEL_BASIC)
+    .set_default(.05)
+    .set_description("Max ratio of misplaced objects to target when throttling data rebalancing activity"),
   });
 }
 
index ca090516c99df09e46a9415ff8ec5f284db1bc0c..bd9ba7942d9c314d369726a587e9369509b0850f 100644 (file)
@@ -17,7 +17,6 @@ from mgr_module import CRUSHMap
 # available modes: 'none', 'crush', 'crush-compat', 'upmap', 'osd_weight'
 default_mode = 'none'
 default_sleep_interval = 60   # seconds
-default_max_misplaced = .05    # max ratio of pgs replaced at a time
 
 TIME_FORMAT = '%Y-%m-%d_%H:%M:%S'
 
@@ -208,7 +207,6 @@ class Module(MgrModule):
             {'name': 'crush_compat_max_iterations'},
             {'name': 'crush_compat_step'},
             {'name': 'end_time'},
-            {'name': 'max_misplaced'},
             {'name': 'min_score'},
             {'name': 'mode'},
             {'name': 'sleep_interval'},
@@ -644,8 +642,7 @@ class Module(MgrModule):
     def optimize(self, plan):
         self.log.info('Optimize plan %s' % plan.name)
         plan.mode = self.get_config('mode', default_mode)
-        max_misplaced = float(self.get_config('max_misplaced',
-                                              default_max_misplaced))
+        max_misplaced = float(self.get_option('target_max_misplaced_ratio'))
         self.log.info('Mode %s, max misplaced %f' %
                       (plan.mode, max_misplaced))
 
@@ -729,8 +726,7 @@ class Module(MgrModule):
         step = float(self.get_config('crush_compat_step', .5))
         if step <= 0 or step >= 1.0:
             return -errno.EINVAL, '"crush_compat_step" must be in (0, 1)'
-        max_misplaced = float(self.get_config('max_misplaced',
-                                              default_max_misplaced))
+        max_misplaced = float(self.get_option('target_max_misplaced_ratio'))
         min_pg_per_osd = 2
 
         ms = plan.initial