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

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.1.7
    • 3.1.8
    • Replication, Shell
    • None
    • Fully Compatible
    • ALL
    • 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);
    • 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

              charlie.swanson@mongodb.com Charlie Swanson
              charlie.swanson@mongodb.com Charlie Swanson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: