title: Connecting to replica set members through a removed member
body: <p>I have a simple replica set with 3 members</p>
  
  <p>Ouput of <strong>rs.status()</strong></p>
  
  <pre><code>{
      ...,
      "members" : [
          {
              "_id": 1,
              "name": "localhost:27021",
              "stateStr": "PRIMARY",
          },
          {
              "_id": 2,
              "name": "localhost:27022",
              "stateStr": "SECONDARY",
          },
          {
              "_id": 3,
              "name": "localhost:27023",
              "stateStr": "SECONDARY",
          }
      ]
  }
  </code></pre>
  
  <p>I removed one member</p>
  
  <pre><code>rs.remove("localhost:27023")
  </code></pre>
  
  <p>Now <strong>rs.status()</strong></p>
  
  <pre><code>{
      ...,
      "members" : [
          {
              "_id": 1,
              "name": "localhost:27021",
              "stateStr": "PRIMARY",
          },
          {
              "_id": 2,
              "name": "localhost:27022",
              "stateStr": "SECONDARY",
          },
      ]
  }
  </code></pre>
  
  <p>Now I used a mongodb connection URL with removed instance. It connected to replica set members successfully!!</p>
  
  <pre><code>var url = 'mongodb://localhost:27023/myproject?replicaSet=rs0';
  MongoClient.connect(url, function(err, db) {
    console.log("Connected correctly to server");
    db.close();
  });
  </code></pre>
  
  <p>I could see the connection was established with replica set members(localhost:27022 and localhost:27023)</p>
  
  <pre><code>2019-04-17T18:59:04.727+0900 I NETWORK  [thread1] connection accepted from 127.0.0.1:53284 #6 (3 connections now open)
  2019-04-17T18:59:04.727+0900 I NETWORK  [conn6] received client metadata from 127.0.0.1:53284 conn6: { driver: { name: "nodejs", version: "3.2.3" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "4.15.0-47-generic" }, platform: "Node.js v10.15.0, LE, mongodb-core: 3.2.3" }
  2019-04-17T18:59:04.736+0900 I -        [conn6] end connection 127.0.0.1:53284 (3 connections now open)
  2019-04-17T18:59:35.334+0900 I ASIO     [NetworkInterfaceASIO-RS-0] Ending idle connection to host localhost:27021 because the pool meets constraints; 1 connections to that host remain open
  </code></pre>
  
  <p>Can someone  explain this?
  Connecting to replica set members through a removed member.
  Could not find any explanation in any docs.</p>