Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-865

Cursor not found when mongos IPs declared in RR DNS

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.2
    • Component/s: MongoDB 3.2
    • Labels:

      I host a MongoDB cluster for users.

      To improve the availability of the cluster, there are multiple mongos instances the users can connect to.

      With their username, password and port, each user gets a hostname (like "beajhmfbjx0yfuo.mongodb.clvrcld.net").
      Originally, we set up the hostname as a CNAME like that:

      beajhmfbjx0yfuo.mongodb.clvrcld.net. 59 IN CNAME mongodb-c1.clvrcld.net.
      mongodb-c1.clvrcld.net. 59      IN      A       195.154.243.92
      mongodb-c1.clvrcld.net. 59      IN      A       195.154.243.93
      mongodb-c1.clvrcld.net. 59      IN      A       195.154.243.94
      

      The problem with that is that the node client queries the DNS every time it wants to perform something across the network. Like a cursor.next().

      Basically, I can configure the node client with many addresses to setup many mongos endpoints. But if I give one domain name only and that name resolves to multiple IPs, the node client will resolve that name often and may pick a different IP each time, then execute the cursor.next() on a different mongos instance than beforeā€¦ and get an error.

      Can you either recognize the roundrobin DNS and setup the different IPs as as many endpoints, or run DNS queries once and for all when creating a connection?

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            judu Julien Durillon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: