From 555d011437bf9094e5ebc8a329e0d281cfd81d72 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 (cherry picked from commit 8f46a351f1fa6f921b373aed4038efc0898a8a44) --- 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 80692929c2b07..7868cd2fbc174 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -1125,7 +1125,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