]> 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)
committerNathan Cutler <ncutler@suse.com>
Wed, 16 Oct 2019 10:57:38 +0000 (12:57 +0200)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 13c4152c8b1756a871f817d4b503396b6c9cc81d)

Conflicts:
src/mds/MDBalancer.cc
- g_conf
- authsubs in method MDBalancer::handle_export_pins() is redeclared from set
  to vector in master branch. Removed vector declaration as per the luminous
  backport.

src/mds/MDBalancer.cc
src/mds/MDBalancer.h

index 582878905e0b090f0f8ab7ec126e1892ff907392..1fdff57dfd6554d57ab4cdce02d23fd12990ffb0 100644 (file)
@@ -162,12 +162,25 @@ void MDBalancer::handle_export_pins(void)
 
   set<CDir *> authsubs;
   mds->mdcache->get_auth_subtrees(authsubs);
+  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->mdsmap->get_max_mds() 
        && 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 c9d7292b369bde6c3e1993d9bc6bfac7e3a2f9fb..c0b92b8d6c43c639ec5fa379f4467e6a820cdbd3 100644 (file)
@@ -78,6 +78,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;