]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: handle DNE beacon from MDS
authorJohn Spray <john.spray@redhat.com>
Tue, 12 May 2015 13:57:17 +0000 (14:57 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 14 May 2015 12:58:31 +0000 (13:58 +0100)
...by calling fail_mds_gid for that MDS.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mon/MDSMonitor.cc

index 34d18d5bfb78b4599a827b15e42f286f4d018478..7dc6c92df8d26cf67ff7a88cc4e55492c82f6cfd 100644 (file)
@@ -579,6 +579,21 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m)
       // after we remove the instance from the map.
       pending_mdsmap.mds_info.erase(gid);
 
+      // Respond to MDS, so that it knows it can continue to shut down
+      mon->send_reply(m, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(),
+                    m->get_name(), mdsmap.get_epoch(), state, seq));
+    } else if (state == MDSMap::STATE_DNE) {
+      if (!mon->osdmon()->is_writeable()) {
+        dout(4) << __func__ << ": DNE from rank " << info.rank
+                << " waiting for osdmon writeable to blacklist it" << dendl;
+        mon->osdmon()->wait_for_writeable(new C_RetryMessage(this, m));
+        return false;
+      }
+
+      fail_mds_gid(gid);
+      assert(mon->osdmon()->is_writeable());
+      request_proposal(mon->osdmon());
+
       // Respond to MDS, so that it knows it can continue to shut down
       mon->send_reply(m, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(),
                     m->get_name(), mdsmap.get_epoch(), state, seq));
@@ -940,6 +955,8 @@ void MDSMonitor::fail_mds_gid(mds_gid_t gid)
   }
 
   pending_mdsmap.mds_info.erase(gid);
+
+  last_beacon.erase(gid);
 }
 
 mds_gid_t MDSMonitor::gid_from_arg(const std::string& arg, std::ostream &ss)