From: Yan, Zheng Date: Fri, 3 Aug 2018 10:43:41 +0000 (+0800) Subject: mds: fix premature stop of MDBalancer::try_rebalance() X-Git-Tag: v13.2.2~23^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4d0f03a1d341366945bccd3c280f10a59f043b73;p=ceph.git mds: fix premature stop of MDBalancer::try_rebalance() When mds wants to export loads to multiple targets. The amount of single export can easily be less than (0.2 * target_loads). For example: 6 active mds, mds.0's load is 11, other ranks' loads are 5. target_load is 6. Export amount for each target is 1. Fixes: http://tracker.ceph.com/issues/26973 Signed-off-by: "Yan, Zheng" (cherry picked from commit e68cbec6a647f0252d848620ce6e51b4f3eea1e3) --- diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 5f4b18bd8804f..b6d649151ba34 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -858,10 +858,10 @@ void MDBalancer::try_rebalance(balance_state_t& state) mds_rank_t target = it.first; double amount = it.second; - if (amount / target_load < .2) - continue; if (amount < MIN_OFFLOAD) continue; + if (amount * 10 * state.targets.size() < target_load) + continue; dout(5) << "want to send " << amount << " to mds." << target //<< " .. " << (*it).second << " * " << load_fac