diff --git a/src/mds/MDSMap.cc b/src/mds/MDSMap.cc index 73c2df98bc0..e93f7a3e0bc 100644 --- a/src/mds/MDSMap.cc +++ b/src/mds/MDSMap.cc @@ -85,6 +85,7 @@ void MDSMap::mds_info_t::dump(Formatter *f) const p != export_targets.end(); ++p) { f->dump_int("mds", *p); } + f->dump_unsigned("features", mds_features); f->close_section(); } @@ -398,7 +399,7 @@ void MDSMap::get_health(list >& summary, void MDSMap::mds_info_t::encode_versioned(bufferlist& bl, uint64_t features) const { - ENCODE_START(4, 4, bl); + ENCODE_START(5, 4, bl); ::encode(global_id, bl); ::encode(name, bl); ::encode(rank, bl); @@ -410,6 +411,7 @@ void MDSMap::mds_info_t::encode_versioned(bufferlist& bl, uint64_t features) con ::encode(standby_for_rank, bl); ::encode(standby_for_name, bl); ::encode(export_targets, bl); + ::encode(mds_features, bl); ENCODE_FINISH(bl); } @@ -432,7 +434,7 @@ void MDSMap::mds_info_t::encode_unversioned(bufferlist& bl) const void MDSMap::mds_info_t::decode(bufferlist::iterator& bl) { - DECODE_START_LEGACY_COMPAT_LEN(4, 4, 4, bl); + DECODE_START_LEGACY_COMPAT_LEN(5, 4, 4, bl); ::decode(global_id, bl); ::decode(name, bl); ::decode(rank, bl); @@ -445,6 +447,8 @@ void MDSMap::mds_info_t::decode(bufferlist::iterator& bl) ::decode(standby_for_name, bl); if (struct_v >= 2) ::decode(export_targets, bl); + if (struct_v >= 5) + ::decode(mds_features, bl); DECODE_FINISH(bl); } diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 16249b0cd9c..4503aac95c0 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -140,6 +140,7 @@ public: mds_rank_t standby_for_rank; std::string standby_for_name; std::set export_targets; + uint64_t mds_features; mds_info_t() : global_id(MDS_GID_NONE), rank(MDS_RANK_NONE), inc(0), state(STATE_STANDBY), state_seq(0), standby_for_rank(MDS_NO_STANDBY_PREF) { } @@ -350,6 +351,19 @@ public: s = failed; } + // features + uint64_t get_up_features() { + uint64_t f = 0; + for (std::map::const_iterator p = up.begin(); + p != up.end(); + ++p) { + std::map::const_iterator q = mds_info.find(p->second); + assert(q != mds_info.end()); + f |= q->second.mds_features; + } + return f; + } + /** * Get MDS ranks which are in but not up. */