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

ReplicaSetMonitor does not randomize host order for getHosts

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc14
    • Affects Version/s: None
    • Component/s: 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

      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.

        1. rsm_host_order.js
          1 kB
          Benjamin Caimano

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

              Created:
              Updated:
              Resolved: