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

src/mds/Migrator.cc

index 6ca71da2fc4a505f6d01d1b1154c0666636cffed..aa25c584ea33278afc262cf48a19d6e73af0d6e4 100644 (file)
@@ -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() &&