From 07dd849be63b530e7fe6f1750f847e9e7385ddb9 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Fri, 13 Dec 2019 17:43:44 -0800 Subject: [PATCH] mgr: Change default upmap_max_deviation to 5 Fixes: https://tracker.ceph.com/issues/43312 Signed-off-by: David Zafman (cherry picked from commit b0a1b758d012dfea40db3feca1a841c96f79defe) Conflicts: src/pybind/mgr/balancer/module.py (default isn't in COMMANDS section) qa/standalone/mgr/balancer.sh (setting upmap_max_deviations to 1 differ) src/test/cli/osdmaptool/missing-argument.t (usage included here) --- doc/man/8/osdmaptool.rst | 2 +- doc/rados/operations/upmap.rst | 2 +- qa/standalone/mgr/balancer.sh | 2 ++ src/pybind/mgr/balancer/module.py | 2 +- src/test/cli/osdmaptool/help.t | 2 +- src/test/cli/osdmaptool/missing-argument.t | 2 +- src/test/cli/osdmaptool/upmap-out.t | 2 +- src/test/cli/osdmaptool/upmap.t | 2 +- src/tools/osdmaptool.cc | 4 ++-- 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/man/8/osdmaptool.rst b/doc/man/8/osdmaptool.rst index 23f415d1da1ae..d5c0c7788b690 100644 --- a/doc/man/8/osdmaptool.rst +++ b/doc/man/8/osdmaptool.rst @@ -92,7 +92,7 @@ Options .. option:: --upmap-deviation - max deviation from target [default: 1] + max deviation from target [default: 5] .. option:: --upmap-pool diff --git a/doc/rados/operations/upmap.rst b/doc/rados/operations/upmap.rst index 3fe65ea8d6f33..8bad0d9592859 100644 --- a/doc/rados/operations/upmap.rst +++ b/doc/rados/operations/upmap.rst @@ -58,7 +58,7 @@ Upmap entries are updated with an offline optimizer built into ``osdmaptool``. If it cannot find any additional changes to make it will stop early (i.e., when the pool distribution is perfect). - The ``max-deviation`` value defaults to `1`. If an OSD PG count + The ``max-deviation`` value defaults to `5`. If an OSD PG count varies from the computed target number by less than or equal to this amount it will be considered perfect. diff --git a/qa/standalone/mgr/balancer.sh b/qa/standalone/mgr/balancer.sh index 71acc0d2ad05a..cd7c0e8a3f97c 100755 --- a/qa/standalone/mgr/balancer.sh +++ b/qa/standalone/mgr/balancer.sh @@ -121,6 +121,8 @@ function TEST_balancer2() { CEPH_ARGS+="--debug_osd=20 " setup $dir || return 1 run_mon $dir a || return 1 + # Must do this before starting ceph-mgr + ceph config-key set mgr/balancer/upmap_max_deviation 1 run_mgr $dir x || return 1 for i in $(seq 0 $(expr $OSDS - 1)) do diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 612015bc1c2a3..23bb72e2a92d8 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -753,7 +753,7 @@ class Module(MgrModule): def do_upmap(self, plan): self.log.info('do_upmap') max_iterations = int(self.get_config('upmap_max_iterations', 10)) - max_deviation = int(self.get_config('upmap_max_deviation', 1)) + max_deviation = int(self.get_config('upmap_max_deviation', 5)) ms = plan.initial if len(plan.pools): diff --git a/src/test/cli/osdmaptool/help.t b/src/test/cli/osdmaptool/help.t index a63a6a08543d8..843211495d338 100644 --- a/src/test/cli/osdmaptool/help.t +++ b/src/test/cli/osdmaptool/help.t @@ -20,7 +20,7 @@ writing commands to [default: - for stdout] --upmap-max set max upmap entries to calculate [default: 10] --upmap-deviation - max deviation from target [default: 1] + max deviation from target [default: 5] --upmap-pool restrict upmap balancing to 1 or more pools --upmap-save write modified OSDMap with upmap changes --upmap-active Act like an active balancer, keep applying changes until balanced diff --git a/src/test/cli/osdmaptool/missing-argument.t b/src/test/cli/osdmaptool/missing-argument.t index 37abf8307c34c..4f4790b6f5453 100644 --- a/src/test/cli/osdmaptool/missing-argument.t +++ b/src/test/cli/osdmaptool/missing-argument.t @@ -20,7 +20,7 @@ writing commands to [default: - for stdout] --upmap-max set max upmap entries to calculate [default: 10] --upmap-deviation - max deviation from target [default: 1] + max deviation from target [default: 5] --upmap-pool restrict upmap balancing to 1 or more pools --upmap-save write modified OSDMap with upmap changes --upmap-active Act like an active balancer, keep applying changes until balanced diff --git a/src/test/cli/osdmaptool/upmap-out.t b/src/test/cli/osdmaptool/upmap-out.t index 8a167aba09a92..02b13ec561b53 100644 --- a/src/test/cli/osdmaptool/upmap-out.t +++ b/src/test/cli/osdmaptool/upmap-out.t @@ -7,7 +7,7 @@ marking OSD@147 as out writing upmap command output to: c checking for upmap cleanups - upmap, max-count 11, max deviation 1 + upmap, max-count 11, max deviation 5 pools rbd prepared 11/11 changes $ cat c diff --git a/src/test/cli/osdmaptool/upmap.t b/src/test/cli/osdmaptool/upmap.t index 8fa1a61031364..23a5d5d32d4bf 100644 --- a/src/test/cli/osdmaptool/upmap.t +++ b/src/test/cli/osdmaptool/upmap.t @@ -6,7 +6,7 @@ marking all OSDs up and in writing upmap command output to: c checking for upmap cleanups - upmap, max-count 11, max deviation 1 + upmap, max-count 11, max deviation 5 pools rbd prepared 11/11 changes $ cat c diff --git a/src/tools/osdmaptool.cc b/src/tools/osdmaptool.cc index 4263e9407bfeb..4cf7f9b552082 100644 --- a/src/tools/osdmaptool.cc +++ b/src/tools/osdmaptool.cc @@ -50,7 +50,7 @@ void usage() cout << " writing commands to [default: - for stdout]" << std::endl; cout << " --upmap-max set max upmap entries to calculate [default: 10]" << std::endl; cout << " --upmap-deviation " << std::endl; - cout << " max deviation from target [default: 1]" << std::endl; + cout << " max deviation from target [default: 5]" << std::endl; cout << " --upmap-pool restrict upmap balancing to 1 or more pools" << std::endl; cout << " --upmap-save write modified OSDMap with upmap changes" << std::endl; cout << " --upmap-active Act like an active balancer, keep applying changes until balanced" << std::endl; @@ -131,7 +131,7 @@ int main(int argc, const char **argv) bool health = false; std::string upmap_file = "-"; int upmap_max = 10; - int upmap_deviation = 1; + int upmap_deviation = 5; bool upmap_active = false; std::set upmap_pools; int64_t pg_num = -1; -- 2.39.5