From: xie xingguo Date: Wed, 31 Jan 2018 02:15:53 +0000 (+0800) Subject: pybind/mgr/balancer: increase bad_steps properly X-Git-Tag: v12.2.5~81^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=48732b7103f4512d24e2922e873ea587d29ead0a;p=ceph.git pybind/mgr/balancer: increase bad_steps properly Signed-off-by: xie xingguo (cherry picked from commit 47d1eb35e746cca2fb394f1905171c6e53a2d8e6) --- diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index f21805ba0e1..3d48cbba694 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -785,6 +785,7 @@ class Module(MgrModule): next_misplaced, max_misplaced, step) else: if next_pe.score > best_pe.score * 1.0001: + bad_steps += 1 if bad_steps < 5 and random.randint(0, 100) < 70: self.log.debug('Score got worse, taking another step') else: