]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: include compatset in beacon message
authorSage Weil <sage@newdream.net>
Thu, 5 Aug 2010 23:48:26 +0000 (16:48 -0700)
committerSage Weil <sage@newdream.net>
Thu, 5 Aug 2010 23:48:26 +0000 (16:48 -0700)
src/mds/MDS.cc
src/messages/MMDSBeacon.h

index c60cc071e296231a1cbffc4fb6f6691bb2fa83c3..198f81c9e667a9519cd6531c3a6e1965dda0e102 100644 (file)
@@ -572,6 +572,9 @@ void MDS::beacon_send()
   beacon->set_standby_for_rank(standby_for_rank);
   beacon->set_standby_for_name(standby_for_name);
 
+  // include _my_ feature set
+  beacon->set_compat(mdsmap_compat);
+
   monc->send_mon_message(beacon);
 
   // schedule next sender
index e6c2dfafb6a7feefc96ea1e24afe25ba85daf011..0e29dadf41e130ddc6af0f3fbd62db94879df79d 100644 (file)
@@ -31,6 +31,8 @@ class MMDSBeacon : public PaxosServiceMessage {
   __s32 standby_for_rank;
   string standby_for_name;
 
+  CompatSet compat;
+
  public:
   MMDSBeacon() : PaxosServiceMessage(MSG_MDS_BEACON, 0) {}
   MMDSBeacon(const ceph_fsid_t &f, uint64_t g, string& n, epoch_t les, int st, version_t se) : 
@@ -51,6 +53,9 @@ public:
   int get_standby_for_rank() { return standby_for_rank; }
   const string& get_standby_for_name() { return standby_for_name; }
 
+  CompatSet& get_compat() { return compat; }
+  void set_compat(CompatSet& c) { compat = c; }
+
   void set_standby_for_rank(int r) { standby_for_rank = r; }
   void set_standby_for_name(string& n) { standby_for_name = n; }
 
@@ -60,6 +65,7 @@ public:
   }
 
   void encode_payload() {
+    header.version = 2;
     paxos_encode();
     ::encode(fsid, payload);
     ::encode(global_id, payload);
@@ -68,6 +74,7 @@ public:
     ::encode(name, payload);
     ::encode(standby_for_rank, payload);
     ::encode(standby_for_name, payload);
+    ::encode(compat, payload);
   }
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
@@ -79,6 +86,8 @@ public:
     ::decode(name, p);
     ::decode(standby_for_rank, p);
     ::decode(standby_for_name, p);
+    if (header.version >= 2)
+      ::decode(compat, p);
   }
 };