[SERVER-20212] Shell cannot connect to a replica set if it had already connected to one with the same name on different ports Created: 31/Aug/15  Updated: 19/Sep/15  Resolved: 09/Sep/15

Status: Closed
Project: Core Server
Component/s: Replication, Shell
Affects Version/s: 3.1.7
Fix Version/s: 3.1.8

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-18268 Support running sharding and replicat... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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
Participants:

 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.



 Comments   
Comment by Githook User [ 09/Sep/15 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-20212 Forget connections to a replica set after it has been shut down

Adds a hook to the Mongo object to tell the ReplicaSetMonitorManager to
stop monitoring a set, which is called in ReplSetTest.stopSet()
Branch: master
https://github.com/mongodb/mongo/commit/3268e47e131c94f9714fe0bfc1cb5260600740a0

Generated at Thu Feb 08 03:53:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.