summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/topology_coordinator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/topology_coordinator.h')
-rw-r--r--src/mongo/db/repl/topology_coordinator.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/mongo/db/repl/topology_coordinator.h b/src/mongo/db/repl/topology_coordinator.h
index d81e9f52154..8747cd489de 100644
--- a/src/mongo/db/repl/topology_coordinator.h
+++ b/src/mongo/db/repl/topology_coordinator.h
@@ -33,9 +33,13 @@
#include <iosfwd>
#include <string>
+#include "mongo/db/repl/is_master_response.h"
#include "mongo/db/repl/last_vote.h"
+#include "mongo/db/repl/repl_set_heartbeat_args_v1.h"
#include "mongo/db/repl/repl_set_heartbeat_response.h"
+#include "mongo/db/repl/repl_set_request_votes_args.h"
#include "mongo/db/repl/replication_coordinator.h"
+#include "mongo/db/repl/replication_metrics_gen.h"
#include "mongo/db/repl/split_horizon.h"
#include "mongo/db/repl/update_position_args.h"
#include "mongo/db/server_options.h"
@@ -646,19 +650,10 @@ public:
*/
int getCurrentPrimaryIndex() const;
- enum StartElectionReason {
- kElectionTimeout,
- kPriorityTakeover,
- kStepUpRequest,
- kStepUpRequestSkipDryRun,
- kCatchupTakeover,
- kSingleNodePromptElection
- };
-
/**
* Transitions to the candidate role if the node is electable.
*/
- Status becomeCandidateIfElectable(const Date_t now, StartElectionReason reason);
+ Status becomeCandidateIfElectable(const Date_t now, StartElectionReasonEnum reason);
/**
* Updates the storage engine read committed support in the TopologyCoordinator options after
@@ -671,6 +666,9 @@ public:
*/
void restartHeartbeats();
+ // Scans through all members that are 'up' and returns the latest known optime.
+ OpTime latestKnownOpTime() const;
+
/**
* Scans through all members that are 'up' and return the latest known optime, if we have
* received (successful or failed) heartbeats from all nodes since heartbeat restart.
@@ -810,7 +808,7 @@ private:
// Returns reason why "self" member is unelectable
UnelectableReasonMask _getMyUnelectableReason(const Date_t now,
- StartElectionReason reason) const;
+ StartElectionReasonEnum reason) const;
// Returns reason why memberIndex is unelectable
UnelectableReasonMask _getUnelectableReason(int memberIndex) const;
@@ -821,9 +819,6 @@ private:
// Return true if we are currently primary
bool _iAmPrimary() const;
- // Scans through all members that are 'up' and return the latest known optime.
- OpTime _latestKnownOpTime() const;
-
// Helper shortcut to self config
const MemberConfig& _selfConfig() const;