From 51a610517dd776b0ca67b8c5b56e3ffcd1aa231d Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 17 May 2016 12:30:26 +0100 Subject: [PATCH] mon,mds: include 'addr' in daemon metadata This is useful for correlating daemon metadata to cluster maps. Signed-off-by: John Spray --- src/mds/Beacon.cc | 1 + src/mon/MonClient.h | 1 + src/mon/Monitor.cc | 1 + 3 files changed, 3 insertions(+) diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index 3cd12cdad17..c6fd128b8a3 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -215,6 +215,7 @@ void Beacon::_send() if (want_state == MDSMap::STATE_BOOT) { map sys_info; collect_sys_info(&sys_info, cct); + sys_info["addr"] = stringify(monc->get_myaddr()); beacon->set_sys_info(sys_info); } monc->send_mon_message(beacon); diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index f0383880ec9..4adf0260cf0 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -370,6 +370,7 @@ public: } void set_messenger(Messenger *m) { messenger = m; } + entity_addr_t get_myaddr() const { return messenger->get_myaddr(); } void send_auth_message(Message *m) { _send_mon_message(m, true); diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index c8a9acdd18e..86ae2cac5b8 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -1910,6 +1910,7 @@ void Monitor::win_election(epoch_t epoch, set& active, uint64_t features, Metadata my_meta; collect_sys_info(&my_meta, g_ceph_context); + my_meta["addr"] = stringify(messenger->get_myaddr()); update_mon_metadata(rank, std::move(my_meta)); } -- 2.39.5