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

Prohibit starting a transaction for maxWireVersion < 7

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.14.1
    • Affects Version/s: None
    • Component/s: libmongoc
    • None

      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.

            Assignee:
            clyde.bazile@mongodb.com Clyde Bazile III (Inactive)
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: