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

Improve wire version checks

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 1.3.0
    • Component/s: None

      We have a lot of "manual" wire version checks all over the place.
      These checks generally check the upper bound, making sure the maxWireVersion is at least X, but we generally don't check that the minWireVersion is equals-to-or-less then X too.

      This isn't an issue today as the server hasn't yet raised its minWireVersion – but when the day comes, our checks become wrong.

      We should refactor these checks into generic wire version compatibility helpers.

      In certain cases we should also raise an error when the user attempts to use certain functionality that isn't available by the server.
      This happens for example when a user specifically provides readConcern, but the server doesn't support it (e.g. MongoDB 3.0).

      It would be nice to be able to automatically set this error too, so the error message and codes would be consistent throughout.

      Then we could have something along the way of

       if (_mongoc_read_concern_version_error (read_concern, server_description, &error)) {
          return false;
       }
       
       _mongoc_append_read_concern (&command, read_concern);
       
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: