The startTransaction section of the Transaction spec states:
startTransaction SHOULD report an error if the driver can detect that transactions are not supported by the deployment. A deployment does not support transactions when the deployment does not support sessions, or maxWireVersion < 7, or the maxWireVersion < 8 and the topology type is Sharded.
CDRIVER-3067 will address the case of a sharded cluster, but libmongoc currently does not prohibit starting a transaction on a server with wire version 6, where sessions are supported but transactions are not (i.e. 3.6). I don't believe we need to worry about wire versions < 6 because it should be impossible to create a session in that topology (it would be wise to confirm this just in case). Nevertheless, we can probably check for maxWireVersion < 7 just to be safe.
I don't believe this is a serious problem, as we can still rely on the server to report an error for an unrecognized command option (e.g. "BSON field 'insert.startTransaction' is an unknown field"); however, libmongoc would still do well to raise a preemptive error in this case to better comply with the spec.
- is depended on by
-
PHPC-1391 Prohibit starting a transaction for maxWireVersion < 7
- Closed
- is related to
-
CDRIVER-3067 Ensure 4.0 drivers return an error when attempting sharded transactions on 4.2
- Closed
- related to
-
CDRIVER-3224 mongoc_client_session_start_transaction should error if server selection fails
- Closed
-
DRIVERS-2133 Require startTransaction to report an error if the driver detects that transactions are not supported
- Closed