]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: send cache rejoin messages after gathering all resolves
authorYan, Zheng <zheng.z.yan@intel.com>
Thu, 14 Mar 2013 07:06:45 +0000 (15:06 +0800)
committerGreg Farnum <greg@inktank.com>
Mon, 1 Apr 2013 16:17:19 +0000 (09:17 -0700)
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mds/MDCache.cc
src/mds/MDCache.h

index b35a987b58a984a0d8df0883ac61319101112a4c..9156e5bb0e0d5daf26ab5cdb959aaa77bfe4d617 100644 (file)
@@ -2918,6 +2918,8 @@ void MDCache::maybe_resolve_finish()
       recalc_auth_bits();
       trim_non_auth(); 
       mds->resolve_done();
+    } else {
+      maybe_send_pending_rejoins();
     }
   }
 }
@@ -3402,6 +3404,13 @@ void MDCache::rejoin_send_rejoins()
 {
   dout(10) << "rejoin_send_rejoins with recovery_set " << recovery_set << dendl;
 
+  if (!resolve_gather.empty()) {
+    dout(7) << "rejoin_send_rejoins still waiting for resolves ("
+           << resolve_gather << ")" << dendl;
+    rejoins_pending = true;
+    return;
+  }
+
   map<int, MMDSCacheRejoin*> rejoins;
 
   // encode cap list once.
@@ -3575,6 +3584,7 @@ void MDCache::rejoin_send_rejoins()
     mds->send_message_mds(p->second, p->first);
   }
   rejoin_ack_gather.insert(mds->whoami);   // we need to complete rejoin_gather_finish, too
+  rejoins_pending = false;
 
   // nothing?
   if (mds->is_rejoin() && rejoins.empty()) {
index 41cd6e7d8d8c00e2a031da8ab71675409f6c171b..99420429f2303b78676004cb53b850d3a4082c6f 100644 (file)
@@ -383,6 +383,7 @@ public:
 
 protected:
   // [rejoin]
+  bool rejoins_pending;
   set<int> rejoin_gather;      // nodes from whom i need a rejoin
   set<int> rejoin_sent;        // nodes i sent a rejoin to
   set<int> rejoin_ack_gather;  // nodes from whom i need a rejoin ack
@@ -417,6 +418,10 @@ protected:
   void handle_cache_rejoin_full(MMDSCacheRejoin *m);
   void rejoin_send_acks();
   void rejoin_trim_undef_inodes();
+  void maybe_send_pending_rejoins() {
+    if (rejoins_pending)
+      rejoin_send_rejoins();
+  }
 public:
   void rejoin_gather_finish();
   void rejoin_send_rejoins();