From: Yan, Zheng Date: Tue, 19 Mar 2019 13:03:10 +0000 (+0800) Subject: mds: open import bounding dirfrags in batch X-Git-Tag: v12.2.13~230^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85d89700e21bcdc105916a2a8bca1a4445512eec;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 1f0dcf2b7f43e93212d56739a9d9d2db771b327f) Conflicts: src/mds/Migrator.cc --- diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 85f6b3b726e..47e7b211d3e 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -2617,6 +2617,7 @@ void Migrator::handle_export_prep(MExportDirPrep *m) if (!finished.empty()) mds->queue_waiters(finished); + MDSGatherBuilder gather(g_ceph_context); bool success = true; if (mds->is_active()) { @@ -2640,9 +2641,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 +2656,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() &&