]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: dont print auth trees if they are too many
authorRishabh Dave <ridave@redhat.com>
Wed, 30 Jan 2019 09:16:36 +0000 (14:46 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 8 Mar 2019 07:01:51 +0000 (12:31 +0530)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/mds/MDBalancer.cc
src/mds/MDBalancer.h

index 8347e1b74fe6f15ce04ddcfa4c247bd5a18f1217..66c5ffe9f16bff400ddf3b8b6d16431e55b35c29 100644 (file)
@@ -148,11 +148,25 @@ void MDBalancer::handle_export_pins(void)
     }
   }
 
-  for (auto &cd : mds->mdcache->get_auth_subtrees()) {
+  std::vector<CDir *> authsubs = mds->mdcache->get_auth_subtrees();
+  bool print_auth_subtrees = true;
+
+  if (authsubs.size() > AUTH_TREES_THRESHOLD &&
+      !g_conf()->subsys.should_gather<ceph_subsys_mds, 25>()) {
+    dout(15) << "number of auth trees = " << authsubs.size() << "; not "
+               "printing auth trees" << dendl;
+    print_auth_subtrees = false;
+  }
+
+  for (auto &cd : authsubs) {
     mds_rank_t export_pin = cd->inode->get_export_pin();
-    dout(10) << "auth tree " << *cd << " export_pin=" << export_pin << dendl;
+
+    if (print_auth_subtrees) {
+      dout(25) << "auth tree " << *cd << " export_pin=" << export_pin <<
+                 dendl;
+    }
+
     if (export_pin >= 0 && export_pin != mds->get_nodeid()) {
-      dout(10) << "exporting auth subtree " << *cd->inode << " to " << export_pin << dendl;
       mds->mdcache->migrator->export_dir(cd, export_pin);
     }
   }
index e89b192d7b2a32afa1d32dee3e5252844ba0b130..d69edd679ef9e9d87e10493e56ae004ac94de16f 100644 (file)
@@ -82,6 +82,7 @@ public:
 private:
   bool bal_fragment_dirs;
   int64_t bal_fragment_interval;
+  static const unsigned int AUTH_TREES_THRESHOLD = 5;
 
   typedef struct {
     std::map<mds_rank_t, double> targets;