From: John Spray Date: Fri, 13 Mar 2015 21:04:34 +0000 (-0400) Subject: mds: introduce DAMAGED state X-Git-Tag: v9.0.0~113^2~15 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d8fa553db98f683efee4bef10db3d1bad525e33a;p=ceph.git mds: introduce DAMAGED state 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 --- diff --git a/src/common/ceph_strings.cc b/src/common/ceph_strings.cc index 41203bc23fceb..dd7c9ed40ba28 100644 --- a/src/common/ceph_strings.cc +++ b/src/common/ceph_strings.cc @@ -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"; diff --git a/src/include/ceph_fs.h b/src/include/ceph_fs.h index d366032c4dae9..9fd4b1a144c99 100644 --- a/src/include/ceph_fs.h +++ b/src/include/ceph_fs.h @@ -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); diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 7933d36a8525a..22cb01021a2d9 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -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: