Go driver does not appear to obey DNS changes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

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

            Assignee:
            Divjot Arora (Inactive)
            Reporter:
            Ben Birt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: