]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: limit run time of load balancer 19220/head
authorYan, Zheng <zyan@redhat.com>
Tue, 3 Apr 2018 04:21:07 +0000 (12:21 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 10 Apr 2018 01:19:48 +0000 (09:19 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/MDBalancer.cc

index 87e044ff2749082b909c64c76ccb554af0bc0e91..4a6123f1792935750516469bb82d38be5baf5e1e 100644 (file)
@@ -974,6 +974,13 @@ void MDBalancer::find_exports(CDir *dir,
                               double& have,
                               set<CDir*>& 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;