]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: mark connection down when MDS fails
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 12 Mar 2013 08:58:08 +0000 (16:58 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Sun, 31 Mar 2013 08:57:14 +0000 (16:57 +0800)
So if the MDS restarts and uses the same address, it does not get
old messages.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/mds/MDS.cc

index 850225668d51f060fe5a8c4b21efd9533c869b62..d2e98fc76c09ee0a59fea12ecf1c507a4f277b92 100644 (file)
@@ -1046,8 +1046,10 @@ void MDS::handle_mds_map(MMDSMap *m)
     oldmap->get_failed_mds_set(oldfailed);
     mdsmap->get_failed_mds_set(failed);
     for (set<int>::iterator p = failed.begin(); p != failed.end(); ++p)
-      if (oldfailed.count(*p) == 0)
+      if (oldfailed.count(*p) == 0) {
+       messenger->mark_down(oldmap->get_inst(*p).addr);
        mdcache->handle_mds_failure(*p);
+      }
     
     // or down then up?
     //  did their addr/inst change?
@@ -1055,8 +1057,10 @@ void MDS::handle_mds_map(MMDSMap *m)
     mdsmap->get_up_mds_set(up);
     for (set<int>::iterator p = up.begin(); p != up.end(); ++p) 
       if (oldmap->have_inst(*p) &&
-         oldmap->get_inst(*p) != mdsmap->get_inst(*p))
+         oldmap->get_inst(*p) != mdsmap->get_inst(*p)) {
+       messenger->mark_down(oldmap->get_inst(*p).addr);
        mdcache->handle_mds_failure(*p);
+      }
   }
   if (is_clientreplay() || is_active() || is_stopping()) {
     // did anyone stop?