From: Jan Fajerski Date: Fri, 8 Dec 2017 15:13:19 +0000 (+0100) Subject: mon: reenable timer to send digest when paxos is temporarily inactive X-Git-Tag: v12.2.3~99^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0aa3c5c577ce4011b727123b45e89648bba32596;p=ceph.git mon: reenable timer to send digest when paxos is temporarily inactive Fixes: http://tracker.ceph.com/issues/22142 Signed-off-by: Jan Fajerski (cherry picked from commit 0457043d2f0040629ec425a356b1bb1f96cf0332) --- diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index a307dd4df5ce..9a68b63652cc 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -453,15 +453,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; @@ -480,6 +481,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) {