bool available = false;
/// the name (foo in mgr.<foo>) of the active daemon
std::string active_name;
+ /// when the active mgr became active, or we lost the active mgr
+ utime_t active_change;
std::map<uint64_t, StandbyInfo> standbys;
uint64_t get_active_gid() const { return active_gid; }
bool get_available() const { return available; }
const std::string &get_active_name() const { return active_name; }
+ const utime_t& get_active_change() const { return active_change; }
bool all_support_module(const std::string& module) {
if (!have_module(module)) {
ENCODE_FINISH(bl);
return;
}
- ENCODE_START(6, 6, bl);
+ ENCODE_START(7, 6, bl);
encode(epoch, bl);
encode(active_addrs, bl, features);
encode(active_gid, bl);
encode(modules, bl);
encode(services, bl);
encode(available_modules, bl);
+ encode(active_change, bl);
ENCODE_FINISH(bl);
return;
}
void decode(bufferlist::const_iterator& p)
{
- DECODE_START(6, p);
+ DECODE_START(7, p);
decode(epoch, p);
decode(active_addrs, p);
decode(active_gid, p);
if (struct_v >= 4) {
decode(available_modules, p);
}
+ if (struct_v >= 7) {
+ decode(active_change, p);
+ } else {
+ active_change = {};
+ }
DECODE_FINISH(p);
}
f->dump_int("active_gid", get_active_gid());
f->dump_string("active_name", get_active_name());
f->dump_object("active_addrs", active_addrs);
+ f->dump_stream("active_change") << active_change;
f->dump_bool("available", available);
f->open_array_section("standbys");
for (const auto &i : standbys) {
<< pending_map.active_name << ")" << dendl;
pending_map.active_gid = m->get_gid();
pending_map.active_name = m->get_name();
+ pending_map.active_change = ceph_clock_now();
pending_map.available_modules = m->get_available_modules();
encode(m->get_metadata(), pending_metadata[m->get_name()]);
pending_metadata_rm.erase(m->get_name());
pending_map.active_name = pending_map.standbys.at(replacement_gid).name;
pending_map.available = false;
pending_map.active_addrs = entity_addrvec_t();
+ pending_map.active_change = ceph_clock_now();
drop_standby(replacement_gid, false);
pending_metadata.erase(pending_map.active_name);
pending_map.active_name = "";
pending_map.active_gid = 0;
+ pending_map.active_change = ceph_clock_now();
pending_map.available = false;
pending_map.active_addrs = entity_addrvec_t();
pending_map.services.clear();