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

isMaster can return duplicate hosts

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: 2.5.2
    • Component/s: Replication
    • None
    • ALL
    • Hide

      Add a sleep in sharding/read_pref_cmd.js:

      sleep(20000); // sleep long enough for                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                   
      // Make sure replica set connection is ready                                                                                                                                                                                                 
      _awaitRSHostViaRSMonitor(st.rs0.nodeList()[0], {ok: true}, "test-rs0");                                                                                                                                                                      
      _awaitRSHostViaRSMonitor(st.rs0.nodeList()[1], {ok: true}, "test-rs0");   
      

      If you set mongos or shell to verbose, you can see the isMaster response in the logs by searching "ReplicaSetMonitor::_checkConnection"

      Show
      Add a sleep in sharding/read_pref_cmd.js: sleep(20000); // sleep long enough for // Make sure replica set connection is ready _awaitRSHostViaRSMonitor(st.rs0.nodeList()[0], {ok: true }, "test-rs0" ); _awaitRSHostViaRSMonitor(st.rs0.nodeList()[1], {ok: true }, "test-rs0" ); If you set mongos or shell to verbose, you can see the isMaster response in the logs by searching "ReplicaSetMonitor::_checkConnection"

      Sample bad response:

      {
      setName: "test-rs0",
      setVersion: 2,
      ismaster: true,
      secondary: false,
      hosts: [
        "Randolphs-MacBook-Air.local:31100",
        "Randolphs-MacBook-Air.local:31101",
        "Randolphs-MacBook-Air.local:31101"
      ],
      primary: "Randolphs-MacBook-Air.local:31100",
      tags: { dc: "ny", tag: "one" },
      me: "Randolphs-MacBook-Air.local:31100",
      maxBsonObjectSize: 16777216,
      maxMessageSizeBytes: 48000000,
      localTime: new Date(1380305413050),
      maxWireVersion: 1,
      minWireVersion: 0,
      ok: 1.0
      }                                                                                                                              
      

      The impact in mongos is that this would cause an assertion failure (and print a stacktrace) and make the nodes unusable (can't perform queries, insert, etc).

            Assignee:
            matt.dannenberg Matt Dannenberg
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: