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

ReplicaSetMonitor should ignore "primary" field in isMaster response

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.2
    • Sprint:
      Service Arch 2019-06-03, Service Arch 2019-06-17

      Description

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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: