]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: mark_down connections to any failed peers
authorSage Weil <sage.weil@dreamhost.com>
Wed, 23 Feb 2011 22:40:38 +0000 (14:40 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Thu, 24 Feb 2011 15:35:29 +0000 (07:35 -0800)
This cleans up messenger state, prevents log spam, and saves a small amount
of memory.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mds/MDS.cc

index 1837f650e8d5106337daeb9cbb8c7fd312867d37..e4359a6c77e8e33d8d128e64099eedf6ea8587ea 100644 (file)
@@ -856,6 +856,16 @@ void MDS::handle_mds_map(MMDSMap *m)
   state = mdsmap->get_state_gid(monc->get_global_id());
   dout(10) << "map says i am " << addr << " mds" << whoami << " state " << ceph_mds_state_name(state) << dendl;
 
+  // mark down any failed peers
+  for (map<uint64_t,MDSMap::mds_info_t>::const_iterator p = oldmap->get_mds_info().begin();
+       p != oldmap->get_mds_info().end();
+       ++p) {
+    if (mdsmap->get_mds_info().count(p->first) == 0) {
+      dout(10) << " peer mds gid " << p->first << " removed from map" << dendl;
+      messenger->mark_down(p->second.addr);
+    }
+  }
+
   if (state != oldstate)
     last_state = oldstate;