From fc0d340876fbcd7d1d262c00b987849c052a296d Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 3 Apr 2018 12:21:07 +0800 Subject: [PATCH] mds: limit run time of load balancer Signed-off-by: "Yan, Zheng" --- src/mds/MDBalancer.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 87e044ff2749..4a6123f17929 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -974,6 +974,13 @@ void MDBalancer::find_exports(CDir *dir, double& have, set& already_exporting) { + utime_t now = ceph_clock_now(); + if ((double)(now - rebalance_time) > 0.1) { + derr << " balancer runs too long" << dendl_impl; + have = amount; + return; + } + assert(dir->is_auth()); double need = amount - have; -- 2.47.3