From: xie xingguo Date: Mon, 29 Jan 2018 03:11:27 +0000 (+0800) Subject: pybind/mgr/balancer: re-initialize everything on instantiating a new Eval X-Git-Tag: v13.0.2~395^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=52e336efc1000e55feb36d82c7324c087d2061c1;p=ceph.git pybind/mgr/balancer: re-initialize everything on instantiating a new Eval Otherwise there might be obsolete pool/root infos etc. Signed-off-by: xie xingguo --- diff --git a/src/pybind/mgr/balancer/module.py b/src/pybind/mgr/balancer/module.py index 45e26069b1403..3d18a78cdc5b6 100644 --- a/src/pybind/mgr/balancer/module.py +++ b/src/pybind/mgr/balancer/module.py @@ -97,28 +97,27 @@ class Plan: class Eval: - root_ids = {} # root name -> id - pool_name = {} # pool id -> pool name - pool_id = {} # pool name -> id - pool_roots = {} # pool name -> root name - root_pools = {} # root name -> pools - target_by_root = {} # root name -> target weight map - count_by_pool = {} - count_by_root = {} - actual_by_pool = {} # pool -> by_* -> actual weight map - actual_by_root = {} # pool -> by_* -> actual weight map - total_by_pool = {} # pool -> by_* -> total - total_by_root = {} # root -> by_* -> total - stats_by_pool = {} # pool -> by_* -> stddev or avg -> value - stats_by_root = {} # root -> by_* -> stddev or avg -> value - - score_by_pool = {} - score_by_root = {} - - score = 0.0 - def __init__(self, ms): self.ms = ms + self.root_ids = {} # root name -> id + self.pool_name = {} # pool id -> pool name + self.pool_id = {} # pool name -> id + self.pool_roots = {} # pool name -> root name + self.root_pools = {} # root name -> pools + self.target_by_root = {} # root name -> target weight map + self.count_by_pool = {} + self.count_by_root = {} + self.actual_by_pool = {} # pool -> by_* -> actual weight map + self.actual_by_root = {} # pool -> by_* -> actual weight map + self.total_by_pool = {} # pool -> by_* -> total + self.total_by_root = {} # root -> by_* -> total + self.stats_by_pool = {} # pool -> by_* -> stddev or avg -> value + self.stats_by_root = {} # root -> by_* -> stddev or avg -> value + + self.score_by_pool = {} + self.score_by_root = {} + + self.score = 0.0 def show(self, verbose=False): if verbose: