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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.8
    • Affects Version/s: 3.1.7
    • Component/s: 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

      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.

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

              Created:
              Updated:
              Resolved: