readPreference=secondary is not respected

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.3.1
    • Affects Version/s: 3.3.0
    • Component/s: Core
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Version 3.3.0 of the Node driver appears to have a regression where readPreference is not adhered to.

      Specifying readPreference=secondary in the connection string with version 3.2.7 results in the find() operation being executed on a secondary node, however the same code with 3.3.0 sees the operation executed on the PRIMARY node.

      Connection string and options:

      var url = "mongodb://JM-METABOX:27001,JM-METABOX:27002,JM-METABOX:27003/?replicaSet=rs&readPreference=secondary";
      const client = new MongoClient(url, { useUnifiedTopology: true, useNewUrlParser: true, monitorCommands: true });
      

              Assignee:
              Matt Broadstone
              Reporter:
              John Murphy
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: