From 0457043d2f0040629ec425a356b1bb1f96cf0332 Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Fri, 8 Dec 2017 16:13:19 +0100 Subject: [PATCH] mon: reenable timer to send digest when paxos is temporarily inactive Fixes: http://tracker.ceph.com/issues/22142 Signed-off-by: Jan Fajerski --- src/mon/MgrMonitor.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index fedd1c1cf6fb4..f47dbfb3f62ac 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -451,15 +451,16 @@ void MgrMonitor::send_digests() { cancel_timer(); - if (!is_active()) { - return; - } - dout(10) << __func__ << dendl; - const std::string type = "mgrdigest"; if (mon->session_map.subs.count(type) == 0) return; + if (!is_active()) { + // if paxos is currently not active, don't send a digest but reenable timer + goto timer; + } + dout(10) << __func__ << dendl; + for (auto sub : *(mon->session_map.subs[type])) { dout(10) << __func__ << " sending digest to subscriber " << sub->session->con << " " << sub->session->con->get_peer_addr() << dendl; @@ -478,6 +479,7 @@ void MgrMonitor::send_digests() sub->session->con->send_message(mdigest); } +timer: digest_event = mon->timer.add_event_after( g_conf->get_val("mon_mgr_digest_period"), new C_MonContext(mon, [this](int) { -- 2.39.5