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

mongoc_collection_read_write_command_with_opts obeys read preference

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.0
    • Affects Version/s: 1.5.0
    • Component/s: libmongoc
    • Labels:
      None

      In 1.5.0 we released a set of generic command methods that let the user declare if she was reading, writing, or reading and writing. This excused libmongoc from maintaining a list of commands that required special logic for applying read preference, read concern, and write concern. For example, mongoc_collection_read_command_with_opts applies read concern from the client, but mongoc_collection_write_command_with_opts does not. See CDRIVER-1527.

      The bug is, mongoc_collection_read_write_command_with_opts obeys read preference: it selects a secondary when connected to a replica set, or sends $readPreference and sets slaveOk when talking to a mongos. Same for mongoc_database_read_write_command_with_opts and mongoc_client_read_write_command_with_opts.

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

              Created:
              Updated:
              Resolved: