diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-10-24 10:12:20 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-10-24 10:13:03 -0400 |
commit | c0fe7490ed8482c5244a36196253883d3c50e7c7 (patch) | |
tree | 90b050a39ccbb5b9796a03b119b71c413c86c098 /src/mongo/client/replica_set_monitor.h | |
parent | 406e1f9e715617956283d32a021fbac7ac46a4cc (diff) | |
download | mongo-c0fe7490ed8482c5244a36196253883d3c50e7c7.tar.gz |
SERVER-26683 Log reason for marking repl hosts as failed in the RSM
Diffstat (limited to 'src/mongo/client/replica_set_monitor.h')
-rw-r--r-- | src/mongo/client/replica_set_monitor.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mongo/client/replica_set_monitor.h b/src/mongo/client/replica_set_monitor.h index 1b2db2c906f..e83f41e4556 100644 --- a/src/mongo/client/replica_set_monitor.h +++ b/src/mongo/client/replica_set_monitor.h @@ -106,12 +106,14 @@ public: Refresher startOrContinueRefresh(); /** - * Notifies this Monitor that a host has failed and should be considered down. + * Notifies this Monitor that a host has failed because of the specified error 'status' and + * should be considered down. * - * Call this when you get a connection error. If you get an error while trying to refresh - * our view of a host, call Refresher::hostFailed() instead. + * Call this when you get a connection error. If you get an error while trying to refresh our + * view of a host, call Refresher::failedHost instead because it bypasses taking the monitor's + * mutex. */ - void failedHost(const HostAndPort& host); + void failedHost(const HostAndPort& host, const Status& status); /** * Returns true if this node is the master based ONLY on local data. Be careful, return may @@ -339,7 +341,7 @@ public: /** * Call this if a host returned from getNextStep failed to reply to an isMaster call. */ - void failedHost(const HostAndPort& host); + void failedHost(const HostAndPort& host, const Status& status); /** * True if this Refresher started a new full scan rather than joining an existing one. @@ -355,15 +357,17 @@ public: private: /** - * First, checks that the "reply" is not from a stale primary by - * comparing the electionId of "reply" to the maxElectionId recorded by the SetState. - * Returns true if "reply" belongs to a non-stale primary. + * First, checks that the "reply" is not from a stale primary by comparing the electionId of + * "reply" to the maxElectionId recorded by the SetState and returns OK status if "reply" + * belongs to a non-stale primary. Otherwise returns a failed status. + * + * The 'from' parameter specifies the node from which the response is received. * * Updates _set and _scan based on set-membership information from a master. * Applies _scan->unconfirmedReplies to confirmed nodes. * Does not update this host's node in _set->nodes. */ - bool receivedIsMasterFromMaster(const IsMasterReply& reply); + Status receivedIsMasterFromMaster(const HostAndPort& from, const IsMasterReply& reply); /** * Adjusts the _scan work queue based on information from this host. |