]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: reenable timer to send digest when paxos is temporarily inactive 19481/head
authorJan Fajerski <jfajerski@suse.com>
Fri, 8 Dec 2017 15:13:19 +0000 (16:13 +0100)
committerJan Fajerski <jfajerski@suse.com>
Wed, 13 Dec 2017 12:58:17 +0000 (13:58 +0100)
Fixes: http://tracker.ceph.com/issues/22142
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit 0457043d2f0040629ec425a356b1bb1f96cf0332)

src/mon/MgrMonitor.cc

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