From 8f46a351f1fa6f921b373aed4038efc0898a8a44 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 7 May 2019 17:10:21 +0800 Subject: [PATCH] mgr/balancer: fix fudge next_* simply record some intermediate results when balancer tries to find something to optimize, whereas best_* are used for the final outputs. Fix by comparing origin_ow with best_ow when determining if we should use a valid fudge value. Signed-off-by: xie xingguo --- src/pybind/mgr/balancer/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index db8ea3c57c9..b7217e47f18 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -1116,7 +1116,7 @@ class Module(MgrModule): # allow a small regression if we are phasing out osd weights fudge = 0 - if next_ow != orig_osd_weight: + if best_ow != orig_osd_weight: fudge = .001 if best_pe.score < pe.score + fudge: -- 2.39.5