]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: introduce DAMAGED state
authorJohn Spray <john.spray@redhat.com>
Fri, 13 Mar 2015 21:04:34 +0000 (17:04 -0400)
committerJohn Spray <john.spray@redhat.com>
Mon, 23 Mar 2015 10:55:07 +0000 (10:55 +0000)
This state is for MDS daemons to report to
the monitor that they encountered an unfixable
error during startup/replay.  The implication
is that this rank should not be assigned to
another MDS daemon until offline repair is
performed, thus avoiding it flapping around
between failing daemons.

Signed-off-by: John Spray <john.spray@redhat.com>
src/common/ceph_strings.cc
src/include/ceph_fs.h
src/mds/MDSMap.h

index 41203bc23fcebf039d7768183bb3b0c77a64c78f..dd7c9ed40ba28a5808821350e080614a32c2bce7 100644 (file)
@@ -64,6 +64,7 @@ const char *ceph_mds_state_name(int s)
                /* down and out */
        case CEPH_MDS_STATE_DNE:        return "down:dne";
        case CEPH_MDS_STATE_STOPPED:    return "down:stopped";
+       case CEPH_MDS_STATE_DAMAGED:   return "down:damaged";
                /* up and out */
        case CEPH_MDS_STATE_BOOT:       return "up:boot";
        case CEPH_MDS_STATE_STANDBY:    return "up:standby";
index d366032c4dae9760a29096f37f5704960470ebdc..9fd4b1a144c99d9ba5b99279629ecb73c4fb20cc 100644 (file)
@@ -253,6 +253,7 @@ struct ceph_mon_subscribe_ack {
 #define CEPH_MDS_STATE_CLIENTREPLAY 12 /* up, replaying client operations */
 #define CEPH_MDS_STATE_ACTIVE       13 /* up, active */
 #define CEPH_MDS_STATE_STOPPING     14 /* up, but exporting metadata */
+#define CEPH_MDS_STATE_DAMAGED      15 /* rank not replayable, need repair */
 
 extern const char *ceph_mds_state_name(int s);
 
index 7933d36a8525a9d63ec4b80bffa6388a63c7daa5..22cb01021a2d96286d97c6d9a97cff74673e44c6 100644 (file)
@@ -100,7 +100,12 @@ public:
     STATE_CLIENTREPLAY = CEPH_MDS_STATE_CLIENTREPLAY, // up, active
     STATE_ACTIVE =     CEPH_MDS_STATE_ACTIVE,         // up, active
     STATE_STOPPING  =  CEPH_MDS_STATE_STOPPING,       // up, exporting metadata (-> standby or out)
-    STATE_DNE       =  CEPH_MDS_STATE_DNE             // down, rank does not exist
+    STATE_DNE       =  CEPH_MDS_STATE_DNE,             // down, rank does not exist
+
+    // State which a daemon may send to MDSMonitor in its beacon
+    // to indicate that offline repair is required.  Daemon must stop
+    // immediately after indicating this state.
+    STATE_DAMAGED   = CEPH_MDS_STATE_DAMAGED
 
     /*
      * In addition to explicit states, an MDS rank implicitly in state: