mirror of
https://github.com/ceph/ceph
synced 2025-01-20 10:01:45 +00:00
mon: use single collect_metadata helper, consistently set 'addr'
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
9099d56e05
commit
c9fa52eab5
@ -1945,8 +1945,7 @@ void Monitor::win_election(epoch_t epoch, set<int>& active, uint64_t features,
|
||||
}
|
||||
|
||||
Metadata my_meta;
|
||||
collect_sys_info(&my_meta, g_ceph_context);
|
||||
my_meta["addr"] = stringify(messenger->get_myaddr());
|
||||
collect_metadata(&my_meta);
|
||||
update_mon_metadata(rank, std::move(my_meta));
|
||||
}
|
||||
|
||||
@ -1976,12 +1975,18 @@ void Monitor::lose_election(epoch_t epoch, set<int> &q, int l,
|
||||
|
||||
if (quorum_con_features & CEPH_FEATURE_MON_METADATA) {
|
||||
Metadata sys_info;
|
||||
collect_sys_info(&sys_info, g_ceph_context);
|
||||
collect_metadata(&sys_info);
|
||||
messenger->send_message(new MMonMetadata(sys_info),
|
||||
monmap->get_inst(get_leader()));
|
||||
}
|
||||
}
|
||||
|
||||
void Monitor::collect_metadata(Metadata *m)
|
||||
{
|
||||
collect_sys_info(m, g_ceph_context);
|
||||
(*m)["addr"] = stringify(messenger->get_myaddr());
|
||||
}
|
||||
|
||||
void Monitor::finish_election()
|
||||
{
|
||||
apply_quorum_to_compatset_features();
|
||||
|
@ -876,6 +876,7 @@ public:
|
||||
int write_default_keyring(bufferlist& bl);
|
||||
void extract_save_mon_key(KeyRing& keyring);
|
||||
|
||||
void collect_metadata(Metadata *m);
|
||||
void update_mon_metadata(int from, Metadata&& m);
|
||||
int load_metadata(map<int, Metadata>& m);
|
||||
void count_metadata(const string& field, Formatter *f);
|
||||
|
Loading…
Reference in New Issue
Block a user