Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1516

Go driver does not appear to obey DNS changes

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      Apologies if this isn't the right place to file this!

       

      I'm running my client code (which uses the Go MongoDB driver) on Kubernetes, along with 3 hosts running MongoDB (in a replica set). The client is configured to connect to "mongodb://mongo-0.mongo,mongo-1.mongo,mongo-2.mongo:27017". This works.

       

       

      However, I have just noticed that if all Mongo replicas restart (and are given new IP addresses by Kubernetes), the client code doesn't seem to pick up this change; trying to run Mongo queries fails with 'connection reset by peer' errors which indicate that the client was trying to communicate with the old IP addresses.

       

      I'm not sure what I should be doing here to handle this. Have we misconfigured some monitor setup, or do we need to configure some DNS resolution refresh frequency option? Should we be using "mongodb+srv" connection strings? I'm a little lost.

      Attachments

        1. mongo.yaml
          2 kB
        2. primaryIsMaster.txt
          1 kB
        3. secondaryIsMaster.txt
          1 kB

        Activity

          People

            divjot.arora@mongodb.com Divjot Arora (Inactive)
            ben@dataform.co Ben Birt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: