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

Read preference should be validated before server selection

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

      From this comment on the PR for CDRIVER-590:

      Previously, such a URI would result in the client's read preference having tags with the primary mode, which is invalid according to the read preference spec and mongoc_read_prefs_is_valid(). That said, mongoc_read_prefs_is_valid() was never actually called anywhere, so I'm not sure how libmongoc handled such a structure.

      So, although mongoc_read_prefs_is_valid() exists, it's never called anywhere (apart from the URI validation added in CDRIVER-590). If we compare this to write concerns, those are checked before any write operation and can yield an error before we send anything to the server. I expect any read operation using a read preference should do the same and yield an error before attempting server selection.

            Assignee:
            fiona.rowan@mongodb.com Fiona Rowan
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: