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

Shell cannot connect to a replica set if it had already connected to one with the same name on different ports

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.1.7
    • Fix Version/s: 3.1.8
    • Component/s: Replication, Shell
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      function startSet(startPort) {
          var rs = new ReplSetTest({startPort: startPort, nodes: 3});
          rs.startSet();
          rs.initiate();
          var m = new Mongo(rs.getURL());
          m.getDB("test").foo.insert({i: 1});
          rs.awaitReplication();
          rs.stopSet();
      }
      startSet(31000);
      startSet(32000);
      

      Show
      function startSet(startPort) { var rs = new ReplSetTest({startPort: startPort, nodes: 3}); rs.startSet(); rs.initiate(); var m = new Mongo(rs.getURL()); m.getDB( "test" ).foo.insert({i: 1}); rs.awaitReplication(); rs.stopSet(); } startSet(31000); startSet(32000);
    • Sprint:
      Quint 9 09/18/15

      Description

      It appears the ReplicaSetMonitor that the shell is using to connect to replica sets is being cached, so that if that replica set is stopped, and a new replica set is started with the same name, it cannot connect to the set.

      This came up while working on SERVER-18272, where moving away from the hard-coded 31000 start port made it impossible to start two sharded clusters with the default name. But I believe the steps to reproduce hit the same issue.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: