]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: reenable timer to send digest when paxos is temporarily inactive 19404/head
authorJan Fajerski <jfajerski@suse.com>
Fri, 8 Dec 2017 15:13:19 +0000 (16:13 +0100)
committerJan Fajerski <jfajerski@suse.com>
Fri, 8 Dec 2017 15:58:23 +0000 (16:58 +0100)
Fixes: http://tracker.ceph.com/issues/22142
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
src/mon/MgrMonitor.cc

index fedd1c1cf6fb4fe8e0687b548a64f2be6822bd41..f47dbfb3f62acc8ce3711eec4716dd969f900c99 100644 (file)
@@ -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<int64_t>("mon_mgr_digest_period"),
     new C_MonContext(mon, [this](int) {