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

ReplicaSetMonitor does not randomize host order for getHosts

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.4.0-rc14
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Hide

      I've attached a javascript test that sends reads in sequence to a 3 node shard and confirms that the third node is not used.

      Show
      I've attached a javascript test that sends reads in sequence to a 3 node shard and confirms that the third node is not used.
    • Sharding 2020-07-27

    Description

      Original description: While there is a function to randomly select, it is only used for single host selection here. This has implications for both connection reuse and read hedging. It means that if we have available connections to all hosts, we will always choose the first one in order if there is an available connection, essentially prioritizing that host. If we are hedging reads, we will also chose the second one in order for our hedge, which prioritizes yet another host and makes that host the one considered the "hedge" for our statistics. We should randomize the multiple host selection here as well.

      Attachments

        Activity

          People

            lamont.nelson@mongodb.com Lamont Nelson
            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: