From: Max Kellermann Date: Mon, 8 Sep 2025 18:45:54 +0000 (+0200) Subject: mon/ElectionLogic: forward-declare class ConnectionTracker X-Git-Tag: v21.0.0~50^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5ccaa44292c194882aa58b0cf35e70df5790fcc9;p=ceph.git mon/ElectionLogic: forward-declare class ConnectionTracker Signed-off-by: Max Kellermann --- diff --git a/src/mon/ElectionLogic.cc b/src/mon/ElectionLogic.cc index be0c35d06ac..0af1c95a619 100644 --- a/src/mon/ElectionLogic.cc +++ b/src/mon/ElectionLogic.cc @@ -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(); diff --git a/src/mon/ElectionLogic.h b/src/mon/ElectionLogic.h index 318ecb56cc6..818e91566f6 100644 --- a/src/mon/ElectionLogic.h +++ b/src/mon/ElectionLogic.h @@ -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.