]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds,mon: include features in beacon messages, MDSMap
authorSage Weil <sage@redhat.com>
Tue, 10 Nov 2015 21:47:11 +0000 (16:47 -0500)
committerSage Weil <sage@redhat.com>
Tue, 1 Mar 2016 16:16:59 +0000 (11:16 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/Beacon.cc
src/messages/MMDSBeacon.h
src/mon/MDSMonitor.cc

index c28f9aaa5b4e8190426f0af3c73f0bace28976d6..08b831b01f1475bb009fae734580da3fee935a81 100644 (file)
@@ -202,7 +202,8 @@ void Beacon::_send()
       name,
       epoch,
       want_state,
-      last_seq);
+      last_seq,
+      CEPH_FEATURES_SUPPORTED_DEFAULT);
 
   beacon->set_standby_for_rank(standby_for_rank);
   beacon->set_standby_for_name(standby_for_name);
index e04fe3736989c6e89c28852a7e93c4ea1811bc4f..1d1f9bc7a4fc355852f0966b716a953d5d778f0d 100644 (file)
@@ -120,7 +120,7 @@ WRITE_CLASS_ENCODER(MDSHealth)
 
 class MMDSBeacon : public PaxosServiceMessage {
 
-  static const int HEAD_VERSION = 4;
+  static const int HEAD_VERSION = 5;
   static const int COMPAT_VERSION = 2;
 
   uuid_d fsid;
@@ -138,12 +138,15 @@ class MMDSBeacon : public PaxosServiceMessage {
 
   map<string, string> sys_info;
 
+  uint64_t mds_features;
+
  public:
   MMDSBeacon() : PaxosServiceMessage(MSG_MDS_BEACON, 0, HEAD_VERSION, COMPAT_VERSION) { }
-  MMDSBeacon(const uuid_d &f, mds_gid_t g, string& n, epoch_t les, MDSMap::DaemonState st, version_t se) : 
+  MMDSBeacon(const uuid_d &f, mds_gid_t g, string& n, epoch_t les, MDSMap::DaemonState st, version_t se, uint64_t feat) :
     PaxosServiceMessage(MSG_MDS_BEACON, les, HEAD_VERSION, COMPAT_VERSION),
     fsid(f), global_id(g), name(n), state(st), seq(se),
-    standby_for_rank(MDS_RANK_NONE) {
+    standby_for_rank(MDS_RANK_NONE),
+    mds_features(feat) {
   }
 private:
   ~MMDSBeacon() {}
@@ -158,6 +161,7 @@ public:
   const char *get_type_name() const { return "mdsbeacon"; }
   mds_rank_t get_standby_for_rank() { return standby_for_rank; }
   const string& get_standby_for_name() { return standby_for_name; }
+  uint64_t get_mds_features() const { return mds_features; }
 
   CompatSet const& get_compat() const { return compat; }
   void set_compat(const CompatSet& c) { compat = c; }
@@ -191,6 +195,7 @@ public:
     if (state == MDSMap::STATE_BOOT) {
       ::encode(sys_info, payload);
     }
+    ::encode(mds_features, payload);
   }
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
@@ -211,6 +216,9 @@ public:
        header.version >= 4) {
       ::decode(sys_info, p);
     }
+    if (header.version >= 5) {
+      ::decode(mds_features, p);
+    }
   }
 };
 
index 4238ffbfc64647179dc289780dd78a801098f285..4477f3c6529f09a4689251ad81f992e8536adc9a 100644 (file)
@@ -375,7 +375,8 @@ bool MDSMonitor::preprocess_beacon(MonOpRequestRef op)
   _note_beacon(m);
   mon->send_reply(op,
                  new MMDSBeacon(mon->monmap->fsid, m->get_global_id(), m->get_name(),
-                                mdsmap.get_epoch(), state, seq));
+                                mdsmap.get_epoch(), state, seq,
+                                CEPH_FEATURES_SUPPORTED_DEFAULT));
   return true;
 
  ignore:
@@ -485,6 +486,7 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
     info.name = m->get_name();
     info.rank = -1;
     info.addr = addr;
+    info.mds_features = m->get_mds_features();
     info.state = MDSMap::STATE_STANDBY;
     info.state_seq = seq;
     info.standby_for_rank = m->get_standby_for_rank();
@@ -600,8 +602,11 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
       pending_mdsmap.mds_info.erase(gid);
 
       // Respond to MDS, so that it knows it can continue to shut down
-      mon->send_reply(op, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(),
-                    m->get_name(), mdsmap.get_epoch(), state, seq));
+      mon->send_reply(op,
+                     new MMDSBeacon(
+                       mon->monmap->fsid, m->get_global_id(),
+                       m->get_name(), mdsmap.get_epoch(), state, seq,
+                       CEPH_FEATURES_SUPPORTED_DEFAULT));
     } else if (state == MDSMap::STATE_DNE) {
       if (!mon->osdmon()->is_writeable()) {
         dout(4) << __func__ << ": DNE from rank " << info.rank
@@ -615,8 +620,11 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
       request_proposal(mon->osdmon());
 
       // Respond to MDS, so that it knows it can continue to shut down
-      mon->send_reply(op, new MMDSBeacon(mon->monmap->fsid, m->get_global_id(),
-                    m->get_name(), mdsmap.get_epoch(), state, seq));
+      mon->send_reply(op,
+                     new MMDSBeacon(
+                       mon->monmap->fsid, m->get_global_id(),
+                       m->get_name(), mdsmap.get_epoch(), state, seq,
+                       CEPH_FEATURES_SUPPORTED_DEFAULT));
     } else {
       info.state = state;
       info.state_seq = seq;
@@ -664,11 +672,12 @@ void MDSMonitor::_updated(MonOpRequestRef op)
     mon->send_reply(op, new MMDSMap(mon->monmap->fsid, &mdsmap));
   } else {
     mon->send_reply(op, new MMDSBeacon(mon->monmap->fsid,
-                                     m->get_global_id(),
-                                     m->get_name(),
-                                     mdsmap.get_epoch(),
-                                     m->get_state(),
-                                     m->get_seq()));
+                                      m->get_global_id(),
+                                      m->get_name(),
+                                      mdsmap.get_epoch(),
+                                      m->get_state(),
+                                      m->get_seq(),
+                                      CEPH_FEATURES_SUPPORTED_DEFAULT));
   }
 }