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

mongoc_client_select_server incorrectly documents default read preference

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.18.0, 1.18.0-alpha
    • None
    • docs
    • None

    Description

      The documentation of mongoc_client_select_server claims that the read preference is inherited by the client if NULL:

      prefs: An optional mongoc_read_prefs_t. If for_writes is true, prefs must be NULL. Otherwise, use prefs to customize server selection, or pass NULL to use the read preference configured on the client.

      But the implemented behavior appears to default to primary (much like the generic command helpers like mongoc_client_command_simple ().

      We should validate this behavior. The existing write concern / read concern / read preference inheritance tests (in test-mongoc-opts.c) do not test mongoc_client_select_server.

      See this PR conversation for more context.
      https://github.com/mongodb/mongo-php-driver/pull/1144#discussion_r448443865

      Attachments

        Activity

          People

            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: