From: Sage Weil Date: Tue, 10 Nov 2015 21:47:11 +0000 (-0500) Subject: mds,mon: include features in beacon messages, MDSMap X-Git-Tag: v10.1.0~241^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e08dd70d7824175c459e6abd810cb19014f61965;p=ceph.git mds,mon: include features in beacon messages, MDSMap Signed-off-by: Sage Weil --- diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index c28f9aaa5b4..08b831b01f1 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -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); diff --git a/src/messages/MMDSBeacon.h b/src/messages/MMDSBeacon.h index e04fe373698..1d1f9bc7a4f 100644 --- a/src/messages/MMDSBeacon.h +++ b/src/messages/MMDSBeacon.h @@ -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 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); + } } }; diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 4238ffbfc64..4477f3c6529 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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)); } }