From: Rishabh Dave Date: Wed, 30 Jan 2019 09:16:36 +0000 (+0530) Subject: mds: dont print auth trees if they are too many X-Git-Tag: v13.2.7~32^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b01b63d334a4e8a7f780b615ae840c0eacda0841;p=ceph.git mds: dont print auth trees if they are too many Signed-off-by: Rishabh Dave (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. --- diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 582878905e0b..1fdff57dfd65 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -162,12 +162,25 @@ void MDBalancer::handle_export_pins(void) set authsubs; mds->mdcache->get_auth_subtrees(authsubs); + bool print_auth_subtrees = true; + + if (authsubs.size() > AUTH_TREES_THRESHOLD && + !g_conf->subsys.should_gather()) { + 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); } } diff --git a/src/mds/MDBalancer.h b/src/mds/MDBalancer.h index c9d7292b369b..c0b92b8d6c43 100644 --- a/src/mds/MDBalancer.h +++ b/src/mds/MDBalancer.h @@ -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 targets;