From: Yan, Zheng Date: Tue, 19 Mar 2019 13:03:10 +0000 (+0800) Subject: mds: open import bounding dirfrags in batch X-Git-Tag: v13.2.7~55^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea214f54805c0300a9b008efb588f2ac29e7e667;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) Note: the first "(cherry picked from . . .)" line is present in the master commit 1f0dcf2b7f43e93212d56739a9d9d2db771b327f Conflicts: src/mds/Migrator.cc - no C_MDS_ExportPrepFactory in mimic --- diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 093f38c3581c..40a8de544bbf 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -2614,6 +2614,8 @@ void Migrator::handle_export_prep(MExportDirPrep *m) dout(7) << " not doing assim on " << *dir << dendl; } + MDSGatherBuilder gather(g_ceph_context); + if (!finished.empty()) mds->queue_waiters(finished); @@ -2640,9 +2642,8 @@ void Migrator::handle_export_prep(MExportDirPrep *m) CDir *bound = cache->get_dirfrag(dirfrag_t(p->first, *q)); if (!bound) { dout(7) << " opening bounding dirfrag " << *q << " on " << *in << dendl; - cache->open_remote_dirfrag(in, *q, - new C_MDS_RetryMessage(mds, m)); - return; + cache->open_remote_dirfrag(in, *q, gather.new_sub()); + continue; } if (!bound->state_test(CDir::STATE_IMPORTBOUND)) { @@ -2656,6 +2657,12 @@ void Migrator::handle_export_prep(MExportDirPrep *m) } } + if (gather.has_subs()) { + gather.set_finisher(new C_MDS_RetryMessage(mds, m)); + gather.activate(); + return; + } + dout(7) << " all ready, noting auth and freezing import region" << dendl; if (!mds->mdcache->is_readonly() &&