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

readPreference=secondary is not respected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.3.1
    • Component/s: core
    • Labels:
      None
    • MongoDB Version:
      4.0.9
    • Case:

      Description

      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 });
      

        Attachments

          Activity

            People

            Assignee:
            matt.broadstone Matt Broadstone
            Reporter:
            john.murphy John Murphy
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: