From 47d1eb35e746cca2fb394f1905171c6e53a2d8e6 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Wed, 31 Jan 2018 10:15:53 +0800 Subject: [PATCH] pybind/mgr/balancer: increase bad_steps properly Signed-off-by: xie xingguo --- src/pybind/mgr/balancer/module.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 0253de9245490..cc8245d208f74 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -767,6 +767,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: -- 2.39.5