diff options
author | Daniel Alabi <alabidan@gmail.com> | 2015-05-29 16:37:42 -0400 |
---|---|---|
committer | Daniel Alabi <alabidan@gmail.com> | 2015-05-29 16:54:49 -0400 |
commit | 6f3fc07e0a9c0bbb8543ec7618debe862a40b3b2 (patch) | |
tree | 62adf7b065790c0221ee9ab819a9922ee32b38ae /src/mongo/client/replica_set_monitor.h | |
parent | 7ebc898162b960e9801d5cf4fed2303aaff43589 (diff) | |
download | mongo-6f3fc07e0a9c0bbb8543ec7618debe862a40b3b2.tar.gz |
SERVER-18280 ReplicaSetMonitor should use electionId to avoid talking to old primaries
Diffstat (limited to 'src/mongo/client/replica_set_monitor.h')
-rw-r--r-- | src/mongo/client/replica_set_monitor.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/client/replica_set_monitor.h b/src/mongo/client/replica_set_monitor.h index 0b06520f5b4..64b7a89274e 100644 --- a/src/mongo/client/replica_set_monitor.h +++ b/src/mongo/client/replica_set_monitor.h @@ -306,12 +306,17 @@ namespace mongo { static ScanStatePtr startNewScan(const SetState* set); 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. + * * 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. */ - void receivedIsMasterFromMaster(const IsMasterReply& reply); + bool receivedIsMasterFromMaster(const IsMasterReply& reply); /** * Adjusts the _scan work queue based on information from this host. |