From: Yan, Zheng Date: Tue, 19 Mar 2019 13:03:10 +0000 (+0800) Subject: mds: open import bounding dirfrags in batch X-Git-Tag: v14.2.2~93^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f37e3457a46e81fa835ac9b4941a95366cb4042b;p=ceph.git mds: open import bounding dirfrags in batch Fixes: http://tracker.ceph.com/issues/38679 Signed-off-by: "Yan, Zheng" (cherry picked from commit 07de3126a8f14f668b3f24a32f3062196e14805d) (cherry picked from commit 1f0dcf2b7f43e93212d56739a9d9d2db771b327f) --- diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 6ca71da2fc4..aa25c584ea3 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -2496,7 +2496,7 @@ void Migrator::handle_export_prep(const MExportDirPrep::const_ref &m, bool did_a dout(7) << " not doing assim on " << *dir << dendl; } - C_MDS_ExportPrepFactory cf(this, m); + MDSGatherBuilder gather(g_ceph_context); if (!finished.empty()) mds->queue_waiters(finished); @@ -2523,8 +2523,8 @@ void Migrator::handle_export_prep(const MExportDirPrep::const_ref &m, bool did_a CDir *bound = cache->get_dirfrag(dirfrag_t(p->first, leaf)); if (!bound) { dout(7) << " opening bounding dirfrag " << leaf << " on " << *in << dendl; - cache->open_remote_dirfrag(in, leaf, cf.build()); - return; + cache->open_remote_dirfrag(in, leaf, gather.new_sub()); + continue; } if (!bound->state_test(CDir::STATE_IMPORTBOUND)) { @@ -2538,6 +2538,13 @@ void Migrator::handle_export_prep(const MExportDirPrep::const_ref &m, bool did_a } } + if (gather.has_subs()) { + C_MDS_ExportPrepFactory cf(this, m); + gather.set_finisher(cf.build()); + gather.activate(); + return; + } + dout(7) << " all ready, noting auth and freezing import region" << dendl; if (!mds->mdcache->is_readonly() &&