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

Read Preference is not correctly passed when connecting to mongos

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      Hi,

      Recently we began using the sharding functionality of MongoDB and we have a cluster of several shards created through Mongo Cloud. The version of MongoDB is 3.2.7 (latest available at the moment).

      We've hit a problem where if we set a readPrefernce to anything different than "primary" it works as "secondaryPreferred". In our case when "nearest" is set - the mongos service logs "secondaryPreferred".

      We've been able to isolate this to a driver issue by writing a simple example in Node.js and in Python and monitoring the mongos log.

      You can find the code examples and the respective logs attached.
      (Obviously we've removed the actual server information)

        1. nodejs.log
          2 kB
        2. python.log
          2 kB
        3. аggregation.js
          0.5 kB
        4. аggregation.py
          0.3 kB

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            boyan.kirov Boyan Kirov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: