-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
v4.2
-
Service Arch 2019-06-03, Service Arch 2019-06-17
The following code in Refresher::receivedIsMasterBeforeFoundMaster is unnecessary now that ReplicaSetMonitor has been rewritten with task executors. Its purpose was to scan a possible primary as soon as possible, but now all possible servers are scanned concurrently. Remove this code for simplicity's sake:
// If this node thinks the primary is someone we haven't tried, make that the next // hostToScan. if (!reply.primary.empty() && !_scan->triedHosts.count(reply.primary)) { std::deque<HostAndPort>::iterator it = std::stable_partition( _scan->hostsToScan.begin(), _scan->hostsToScan.end(), HostIs(reply.primary)); if (it == _scan->hostsToScan.begin()) { // reply.primary wasn't in hostsToScan _scan->hostsToScan.push_front(reply.primary); } }