]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/ElectionLogic: forward-declare class ConnectionTracker
authorMax Kellermann <max.kellermann@ionos.com>
Mon, 8 Sep 2025 18:45:54 +0000 (20:45 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Tue, 16 Sep 2025 10:42:05 +0000 (12:42 +0200)
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/mon/ElectionLogic.cc
src/mon/ElectionLogic.h

index be0c35d06ac523ab67f3bd292e256d2ada374df4..0af1c95a619136a5e5a5728338629e96fe6fcf37 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include "ElectionLogic.h"
+#include "ConnectionTracker.h"
 
 #include "include/ceph_assert.h"
 #include "common/dout.h"
@@ -55,6 +56,21 @@ static ostream& _prefix(std::ostream *_dout, epoch_t epoch, ElectionOwner* elect
   return *_dout << "paxos." << elector->get_my_rank()
                << ").electionLogic(" <<  epoch << ") ";
 }
+
+ElectionLogic::ElectionLogic(ElectionOwner *e, election_strategy es, ConnectionTracker *t,
+                            double ipm,
+                            CephContext *c) : elector(e), peer_tracker(t), cct(c),
+                                              last_election_winner(-1), last_voted_for(-1),
+                                              ignore_propose_margin(ipm),
+                                              stable_peer_tracker(),
+                                              leader_peer_tracker(),
+                                              leader_acked(-1),
+                                              strategy(es),
+                                              participating(true),
+                                              electing_me(false) {}
+
+ElectionLogic::~ElectionLogic() noexcept = default;
+
 void ElectionLogic::init()
 {
   epoch = elector->read_persisted_epoch();
index 318ecb56cc6d694b9f726d2bb95241a4c63bc549..818e91566f6180f0ca8f4e3b64762ceb4e59f450 100644 (file)
@@ -23,7 +23,8 @@
 #include "common/ceph_context.h"
 #include "include/buffer_fwd.h"
 #include "include/types.h"
-#include "ConnectionTracker.h"
+
+class ConnectionTracker;
 
 class ElectionOwner {
 public:
@@ -226,15 +227,10 @@ public:
 
   ElectionLogic(ElectionOwner *e, election_strategy es, ConnectionTracker *t,
                double ipm,
-               CephContext *c) : elector(e), peer_tracker(t), cct(c),
-                                 last_election_winner(-1), last_voted_for(-1),
-                                 ignore_propose_margin(ipm),
-                                 stable_peer_tracker(),
-                                 leader_peer_tracker(),
-                                 leader_acked(-1),
-                                 strategy(es),
-                                 participating(true),
-                                 electing_me(false) {}
+               CephContext *c);
+
+  ~ElectionLogic() noexcept;
+
   /**
    * Set the election strategy to use. If this is not consistent across the
    * electing cluster, you're going to have a bad time.