From 55088f7bbe06547bea377752f73bfa258b688afb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 24 Feb 2017 22:28:25 -0500 Subject: [PATCH] mon/MgrMonitor: feed our MgrClient MgrMaps We don't have a MonClient so we don't subscribe to these in the usual way. This will do. Signed-off-by: Sage Weil --- src/mon/MgrMonitor.cc | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index d9cee80b463..871478a7b3e 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -33,23 +33,24 @@ void MgrMonitor::create_initial() void MgrMonitor::update_from_paxos(bool *need_bootstrap) { version_t version = get_last_committed(); - if (version == map.epoch) { - return; + if (version != map.epoch) { + dout(4) << "loading version " << version << dendl; + + bufferlist bl; + int err = get_version(version, bl); + assert(err == 0); + + bufferlist::iterator p = bl.begin(); + map.decode(p); + + dout(4) << "active server: " << map.active_addr + << "(" << map.active_gid << ")" << dendl; + + check_subs(); } - dout(4) << "loading version " << version << dendl; - - bufferlist bl; - int err = get_version(version, bl); - assert(err == 0); - - bufferlist::iterator p = bl.begin(); - map.decode(p); - - dout(4) << "active server: " << map.active_addr - << "(" << map.active_gid << ")" << dendl; - - check_subs(); + // feed our pet MgrClient + mon->mgr_client.ms_dispatch(new MMgrMap(map)); } void MgrMonitor::create_pending()