]> 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>
Wed, 24 Apr 2019 10:30:55 +0000 (16:00 +0530)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 13c4152c8b1756a871f817d4b503396b6c9cc81d)

Conflicts:
src/mds/MDBalancer.cc
authsubs in method MDBalancer::handle_export_pins() is redeclared from
set to vector in master branch. I've removed vector declaration, which
was the only source conflict.

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

index 013901c77a3bb65950ccef694916d1a68ae1c75d..aaad1767b7b573811e58d64f550581d8f73a0ddd 100644 (file)
@@ -149,11 +149,24 @@ 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->get_nodeid()) {
-      dout(10) << "exporting auth subtree " << *cd->inode << " to " << export_pin << dendl;
       mds->mdcache->migrator->export_dir(cd, export_pin);
     }
   }
index 1ca3ea08bdc05f2eaf7c5f4993415c7fc97e19b9..acf730316b6e437f14dc5ee768fdadf3283136db 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;