From: Yan, Zheng Date: Mon, 20 Mar 2017 09:48:38 +0000 (+0800) Subject: mds: speed-up subtree exporting during mds shutdown X-Git-Tag: v12.0.2~112^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=53448bf7506cd60018472e9ea838b3b6fcbb53b5;p=ceph.git mds: speed-up subtree exporting during mds shutdown Signed-off-by: "Yan, Zheng" --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 09f1113e61f6..88832279d2fd 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); } }