class MMgrBeacon : public PaxosServiceMessage {
private:
- static constexpr int HEAD_VERSION = 8;
+ static constexpr int HEAD_VERSION = 9;
static constexpr int COMPAT_VERSION = 8;
protected:
map<string,string> metadata; ///< misc metadata about this osd
+ uint64_t mgr_features = 0; ///< reporting mgr's features
+
public:
MMgrBeacon()
: PaxosServiceMessage{MSG_MGR_BEACON, 0, HEAD_VERSION, COMPAT_VERSION},
MMgrBeacon(const uuid_d& fsid_, uint64_t gid_, const std::string &name_,
entity_addrvec_t server_addrs_, bool available_,
std::vector<MgrMap::ModuleInfo>&& modules_,
- map<string,string>&& metadata_)
+ map<string,string>&& metadata_,
+ uint64_t feat)
: PaxosServiceMessage{MSG_MGR_BEACON, 0, HEAD_VERSION, COMPAT_VERSION},
gid(gid_), server_addrs(server_addrs_), available(available_), name(name_),
- fsid(fsid_), modules(std::move(modules_)), metadata(std::move(metadata_))
+ fsid(fsid_), modules(std::move(modules_)), metadata(std::move(metadata_)),
+ mgr_features(feat)
{
}
const std::map<std::string,std::string>& get_metadata() const {
return metadata;
}
-
const std::map<std::string,std::string>& get_services() const {
return services;
}
+ uint64_t get_mgr_features() const { return mgr_features; }
void set_services(const std::map<std::string, std::string> &svcs)
{
encode(services, payload);
encode(modules, payload);
+ encode(mgr_features, payload);
}
void decode_payload() override {
auto p = payload.cbegin();
if (header.version >= 7) {
decode(modules, p);
}
+ if (header.version >= 9) {
+ decode(mgr_features, p);
+ }
}
private:
template<class T, typename... Args>
addrs,
available,
std::move(module_info),
- std::move(metadata));
+ std::move(metadata),
+ CEPH_FEATURES_ALL);
if (available) {
if (!available_in_map) {
class StandbyInfo
{
public:
- uint64_t gid;
+ uint64_t gid = 0;
std::string name;
std::vector<ModuleInfo> available_modules;
+ uint64_t mgr_features = 0;
StandbyInfo(uint64_t gid_, const std::string &name_,
- const std::vector<ModuleInfo>& am)
- : gid(gid_), name(name_), available_modules(am)
+ const std::vector<ModuleInfo>& am,
+ uint64_t feat)
+ : gid(gid_), name(name_), available_modules(am),
+ mgr_features(feat)
{}
- StandbyInfo()
- : gid(0)
- {}
+ StandbyInfo() {}
void encode(ceph::buffer::list& bl) const
{
- ENCODE_START(3, 1, bl);
+ ENCODE_START(4, 1, bl);
encode(gid, bl);
encode(name, bl);
std::set<std::string> old_available_modules;
}
encode(old_available_modules, bl); // version 2
encode(available_modules, bl); // version 3
+ encode(mgr_features, bl); // v4
ENCODE_FINISH(bl);
}
void decode(ceph::buffer::list::const_iterator& p)
{
- DECODE_START(3, p);
+ DECODE_START(4, p);
decode(gid, p);
decode(name, p);
if (struct_v >= 2) {
if (struct_v >= 3) {
decode(available_modules, p);
}
+ if (struct_v >= 4) {
+ decode(mgr_features, p);
+ }
DECODE_FINISH(p);
}
std::string active_name;
/// when the active mgr became active, or we lost the active mgr
utime_t active_change;
+ /// features
+ uint64_t active_mgr_features = 0;
std::map<uint64_t, StandbyInfo> standbys;
ENCODE_FINISH(bl);
return;
}
- ENCODE_START(8, 6, bl);
+ ENCODE_START(9, 6, bl);
encode(epoch, bl);
encode(active_addrs, bl, features);
encode(active_gid, bl);
encode(available_modules, bl);
encode(active_change, bl);
encode(always_on_modules, bl);
+ encode(active_mgr_features, bl);
ENCODE_FINISH(bl);
return;
}
void decode(ceph::buffer::list::const_iterator& p)
{
- DECODE_START(7, p);
+ DECODE_START(8, p);
decode(epoch, p);
decode(active_addrs, p);
decode(active_gid, p);
if (struct_v >= 8) {
decode(always_on_modules, p);
}
+ if (struct_v >= 9) {
+ decode(active_mgr_features, p);
+ }
DECODE_FINISH(p);
}
f->dump_object("active_addrs", active_addrs);
f->dump_stream("active_addr") << active_addrs.get_legacy_str();
f->dump_stream("active_change") << active_change;
+ f->dump_unsigned("active_mgr_features", active_mgr_features);
f->dump_bool("available", available);
f->open_array_section("standbys");
for (const auto &i : standbys) {
for (const auto& j : i.second.available_modules) {
j.dump(f);
}
+ f->dump_unsigned("mgr_features", i.second.mgr_features);
f->close_section();
f->close_section();
}
pending_map.active_gid = m->get_gid();
pending_map.active_name = m->get_name();
pending_map.active_change = ceph_clock_now();
+ pending_map.active_mgr_features = m->get_mgr_features();
pending_map.available_modules = m->get_available_modules();
encode(m->get_metadata(), pending_metadata[m->get_name()]);
pending_metadata_rm.erase(m->get_name());
mon->clog->debug() << "Standby manager daemon " << m->get_name()
<< " started";
pending_map.standbys[m->get_gid()] = {m->get_gid(), m->get_name(),
- m->get_available_modules()};
+ m->get_available_modules(),
+ m->get_mgr_features()};
encode(m->get_metadata(), pending_metadata[m->get_name()]);
pending_metadata_rm.erase(m->get_name());
updated = true;
auto replacement_gid = pending_map.standbys.begin()->first;
pending_map.active_gid = replacement_gid;
pending_map.active_name = pending_map.standbys.at(replacement_gid).name;
+ pending_map.active_mgr_features =
+ pending_map.standbys.at(replacement_gid).mgr_features;
pending_map.available = false;
pending_map.active_addrs = entity_addrvec_t();
pending_map.active_change = ceph_clock_now();
pending_map.active_name = "";
pending_map.active_gid = 0;
pending_map.active_change = ceph_clock_now();
+ pending_map.active_mgr_features = 0;
pending_map.available = false;
pending_map.active_addrs = entity_addrvec_t();
pending_map.services.clear();