]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: reset heartbeat map at potential time-consuming places
authorYan, Zheng <zyan@redhat.com>
Wed, 11 Jul 2018 09:30:39 +0000 (17:30 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 9 Aug 2018 09:09:33 +0000 (17:09 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Fixes: http://tracker.ceph.com/issues/26858
(cherry picked from commit 5a6a9a3fdafa4d68d337e031dd2358215771be8f)

 Conflicts:
src/mds/Migrator.cc
src/mds/MDSRank.h

src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/Migrator.cc

index bdebfed5bf994a68bfdda315047e9c1fe47bf5dc..7f6f15b9a02bc699b9297eb51748c6d44f8870c4 100644 (file)
@@ -1827,7 +1827,7 @@ void MDSRankDispatcher::handle_mds_map(
       list<MDSInternalContextBase*> ls;
       ls.swap(p->second);
       waiting_for_mdsmap.erase(p++);
-      finish_contexts(g_ceph_context, ls);
+      queue_waiters(ls);
     }
   }
 
index d26627e8e0c2f7075e11f99b98c31145ae97eaeb..e524f99174a7b0eded4f9b696c4ca0a0894fef77 100644 (file)
@@ -301,6 +301,10 @@ class MDSRank {
       finished_queue.splice( finished_queue.end(), ls );
       progress_thread.signal();
     }
+    void queue_waiters_front(std::list<MDSInternalContextBase*>& ls) {
+      finished_queue.splice(finished_queue.begin(), ls);
+      progress_thread.signal();
+    }
 
     MDSRank(
         mds_rank_t whoami_,
index f58ec7fd7ef52ec8ebe4a1ac8df2c09db39d3b2e..b66d12d1a74b69d1598cc6cbb3d837ef7b79accf 100644 (file)
@@ -2606,6 +2606,15 @@ void Migrator::import_remove_pins(CDir *dir, set<CDir*>& bounds)
   }
 }
 
+class C_MDC_QueueContexts : public MigratorContext {
+public:
+  list<MDSInternalContextBase*> contexts;
+  C_MDC_QueueContexts(Migrator *m) : MigratorContext(m) {}
+  void finish(int r) override {
+    // execute contexts immediately after 'this' context
+    get_mds()->queue_waiters_front(contexts);
+  }
+};
 
 /*
  * note: this does teh full work of reversing and import and cleaning up
@@ -2633,7 +2642,7 @@ void Migrator::import_reverse(CDir *dir)
 
   cache->adjust_subtree_auth(dir, stat.peer);
 
-  C_ContextsBase<MDSInternalContextBase, MDSInternalContextGather> *fin = new C_ContextsBase<MDSInternalContextBase, MDSInternalContextGather>(g_ceph_context);
+  auto fin = new C_MDC_QueueContexts(this);
   if (!dir->get_inode()->is_auth() &&
       !dir->get_inode()->has_subtree_root_dirfrag(mds->get_nodeid())) {
     dir->get_inode()->clear_scatter_dirty();