Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-704

$readPreference sent to non-mongos

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2-rc0
    • Affects Version/s: None
    • Component/s: libmongoc
    • None

      Revealed testing CDRIVER-679, the driver sends

      { $query: { ... }, $readPreference: { mode: "secondary", tags: [] } }
      

      to a replica set secondary.

      Uncomment the query pattern in _test_kill_cursors to reproduce.

      To match Server Selection, the driver must send $readPreference only to mongos:

      https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#passing-read-preference-to-mongos

      Verify the rest of $readPreference and slaveOkay-bit handling, too.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: