]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/mon/Elector.cc: Improve logging for the elector
authorKamoltat Sirivadhna <ksirivad@redhat.com>
Fri, 18 Jul 2025 04:58:26 +0000 (04:58 +0000)
committerKamoltat Sirivadhna <ksirivad@redhat.com>
Tue, 7 Oct 2025 19:53:00 +0000 (19:53 +0000)
Fixes: https://tracker.ceph.com/issues/71344
Signed-off-by: Kamoltat Sirivadhna <ksirivad@redhat.com>
src/mon/Elector.cc

index bfc854d6bdcf7e13a78ea2eae52abfa22829b5a0..e70e8d1685985170d573b94e0dffb9211325cd4e 100644 (file)
@@ -454,7 +454,10 @@ void Elector::begin_peer_ping(int peer)
 {
   dout(20) << __func__ << " with " << peer << dendl;
   if (live_pinging.count(peer)) {
-    dout(20) << peer << " already in live_pinging ... return " << dendl;
+    // This peer is already being pinged
+    // so we don't need to schedule another ping_check
+    // against it, ping_check will call itself because it is self-sustaining.
+    dout(20) << peer << " is already being pinged ... return " << dendl;
     return;
   }
   // Check if quorum feature is not set and we are in
@@ -482,7 +485,8 @@ void Elector::begin_peer_ping(int peer)
       << " no need to schedule ping_check" << dendl;
     return;
   }
-  dout(30) << "schedule ping_check against peer: " << peer << dendl;
+  dout(30) << "schedule ping_check against peer: "
+    << peer << " every " << ping_timeout / PING_DIVISOR << "s" << dendl;
   mon->timer.add_event_after(ping_timeout / PING_DIVISOR,
                             new C_MonContext{mon, [this, peer](int) {
                                 ping_check(peer);
@@ -511,7 +515,7 @@ bool Elector::send_peer_ping(int peer, const utime_t *n)
   MMonPing *ping = new MMonPing(MMonPing::PING, now, peer_tracker.get_encoded_bl());
   mon->messenger->send_to_mon(ping, mon->monmap->get_addrs(peer));
   peer_sent_ping[peer] = now;
-  dout(20) << " sent ping successfully to peer: " << peer << dendl;
+  dout(20) << " sent ping to peer: " << peer << " at " << now << dendl;
   return true;
 }
 
@@ -559,7 +563,9 @@ void Elector::ping_check(int peer)
     }
   }
 
-  dout(30) << "schedule " << __func__ << " against peer: "<< peer << dendl;
+  dout(30) << "Scheduling next ping_check for peer "
+    << peer << " in " << ping_timeout / PING_DIVISOR
+    << "s (recursively call ping_check until connection state changes)" << dendl;
   mon->timer.add_event_after(ping_timeout / PING_DIVISOR,
                             new C_MonContext{mon, [this, peer](int) {
                                 ping_check(peer);