Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-932

Cluster can have references to duplicate nodes

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.6
    • Affects Version/s: 2.0.4
    • Component/s: Replica Set
    • Labels:
      None

      I have a single-node replica set which contains a single node, "luna:27019", listening on 0.0.0.0

      When I connect with anything except the name known to the RS, I end up with duplicate servers in the cluster list:

      > m = Mongo::Client.new ["localhost:27019"], replica_set: "kerrigan", read: {mode: :secondary_preferred}
       => #<Mongo::Client:0x2384 cluster=localhost:27019, luna:27019>
      > m.cluster
       => #<Mongo::Cluster:0x2386 servers=[#<Mongo::Server:0x2388 address=luna:27019>, #<Mongo::Server:0x2390 address=localhost:27019>] topology=Replica Set>
      

      This is because the seed list and the discovered node list are shared. These should probably be split, so that the seeds are kept separate from the discovered nodes, and only used to find a node to discover topology from.

      This server list is then used during server selection, so it's possible that seeds duplicating known nodes could cause those nodes to be weighted more heavily for operation selection.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            cheald Chris Heald
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: