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);
- depends on
-
CDRIVER-1527 Add mongoc_client_[read|write|read_write]_command_with_opts
- Closed
- related to
-
CDRIVER-689 Detect incompatible wire versions
- Closed