]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: open import bounding dirfrags in batch 27051/head
authorYan, Zheng <zyan@redhat.com>
Tue, 19 Mar 2019 13:03:10 +0000 (21:03 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 3 Apr 2019 13:41:00 +0000 (21:41 +0800)
Fixes: http://tracker.ceph.com/issues/38679
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 07de3126a8f14f668b3f24a32f3062196e14805d)

src/mds/Migrator.cc

index 847e2e0d47e10c253719cda39559fa8a6aad01b1..81829d22bc5dd2687bfd3672714b4739e2e35ffc 100644 (file)
@@ -2505,7 +2505,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);
@@ -2532,8 +2532,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)) {
@@ -2547,6 +2547,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() &&