summaryrefslogtreecommitdiff
path: root/src/mongo/client/replica_set_monitor_internal.h
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2016-07-18 14:51:13 -0400
committerMisha Tyulenev <misha@mongodb.com>2016-07-19 11:48:38 -0400
commit58d46adb375b7797a168a81f961aa10be1f6b32d (patch)
treeb288f2eebfea6a9e4eff46dacf2daba0dbb09420 /src/mongo/client/replica_set_monitor_internal.h
parentdb4149d0f5a92249f117f69c2f4749c923141289 (diff)
downloadmongo-58d46adb375b7797a168a81f961aa10be1f6b32d.tar.gz
SERVER-24676 implement support for maxStalenessMS in ReplicaSetMonitor
Diffstat (limited to 'src/mongo/client/replica_set_monitor_internal.h')
-rw-r--r--src/mongo/client/replica_set_monitor_internal.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/mongo/client/replica_set_monitor_internal.h b/src/mongo/client/replica_set_monitor_internal.h
index 4dbf9cb7996..eff1670d558 100644
--- a/src/mongo/client/replica_set_monitor_internal.h
+++ b/src/mongo/client/replica_set_monitor_internal.h
@@ -68,17 +68,18 @@ struct ReplicaSetMonitor::IsMasterReply {
bool isMaster;
bool secondary;
bool hidden;
- int configVersion{0};
+ int configVersion{};
OID electionId; // Set if this isMaster reply is from the primary
HostAndPort primary; // empty if not present
std::set<HostAndPort> normalHosts; // both "hosts" and "passives"
BSONObj tags;
- int minWireVersion{0};
- int maxWireVersion{0};
+ int minWireVersion{};
+ int maxWireVersion{};
// remaining fields aren't in isMaster reply, but are known to caller.
HostAndPort host;
int64_t latencyMicros; // ignored if negative
+ Date_t lastWriteDate{};
};
struct ReplicaSetMonitor::SetState {
@@ -117,11 +118,14 @@ public:
HostAndPort host;
bool isUp{false};
- bool isMaster{false}; // implies isUp
- int64_t latencyMicros; // unknownLatency if unknown
- BSONObj tags; // owned
- int minWireVersion{0};
- int maxWireVersion{0};
+ bool isMaster{false};
+ int64_t latencyMicros{};
+ BSONObj tags; // owned
+ int minWireVersion{};
+ int maxWireVersion{};
+ Date_t lastWriteDate{}; // from isMasterReply
+ Date_t lastWriteDateUpdateTime{}; // set to the local system's time at the time of updating
+ // lastWriteDate
};
typedef std::vector<Node> Nodes;