Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-40489

ReplicaSetMonitor should ignore "primary" field in isMaster response

    • 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);
              }
          }
      

            Assignee:
            shelley.jain@mongodb.com Shaileja Jain (Inactive)
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: