From 53448bf7506cd60018472e9ea838b3b6fcbb53b5 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 20 Mar 2017 17:48:38 +0800 Subject: [PATCH] mds: speed-up subtree exporting during mds shutdown Signed-off-by: "Yan, Zheng" --- src/mds/MDCache.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 09f1113e61f..88832279d2f 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -7470,9 +7470,7 @@ bool MDCache::shutdown_pass() int num_auth_subtree = 0; if (!subtrees.empty() && mds->get_nodeid() != 0 && - !migrator->is_exporting() //&& - //!migrator->is_importing() - ) { + migrator->get_export_queue_size() == 0) { dout(7) << "looking for subtrees to export to mds0" << dendl; list ls; for (map >::iterator it = subtrees.begin(); @@ -7485,21 +7483,19 @@ bool MDCache::shutdown_pass() num_auth_subtree++; if (dir->is_frozen() || dir->is_freezing() || - dir->is_ambiguous_dir_auth()) + dir->is_ambiguous_dir_auth() || + dir->state_test(CDir::STATE_EXPORTING)) continue; ls.push_back(dir); } } - int max = 5; // throttle shutdown exports.. hack! for (list::iterator p = ls.begin(); p != ls.end(); ++p) { CDir *dir = *p; mds_rank_t dest = dir->get_inode()->authority().first; if (dest > 0 && !mds->mdsmap->is_active(dest)) dest = 0; dout(7) << "sending " << *dir << " back to mds." << dest << dendl; - migrator->export_dir(dir, dest); - if (--max == 0) - break; + migrator->export_dir_nicely(dir, dest); } } -- 2.47.3