mongoc_client_select_server incorrectly documents default read preference

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.18.0, 1.18.0-alpha
    • Affects Version/s: None
    • Component/s: Docs
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Samantha Ritter (Inactive)
            Reporter:
            Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: