]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: open import bounding dirfrags in batch 28432/head
authorYan, Zheng <zyan@redhat.com>
Tue, 19 Mar 2019 13:03:10 +0000 (21:03 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 6 Jun 2019 13:43:25 +0000 (21:43 +0800)
Fixes: http://tracker.ceph.com/issues/38679
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 1f0dcf2b7f43e93212d56739a9d9d2db771b327f)

 Conflicts:
src/mds/Migrator.cc

src/mds/Migrator.cc

index 85f6b3b726ebd9b88f9f49e3a02881d415c65c0b..47e7b211d3edbe95bdcaf65917e16d537d281397 100644 (file)
@@ -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() &&