Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3240

No exception thrown when attempting sharded transactions on 4.2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.10.2
    • Component/s: Transaction Management
    • Labels:
      None

      Description

      The 4.0 transaction spec says:

      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 topology type is Sharded

      https://github.com/mongodb/specifications/blob/cf7248b2574b1a5397a6e18362acfe66f2b55a43/source/transactions/transactions.rst#starttransaction

      However, the Java driver never implemented this check. When 3.10.1 runs a transaction against MongoDB 4.2, it will get an error like this on the first command that goes to a new mongos:

      {
        'ok': 0.0,
        'errmsg': 'cannot continue txnId -1 for session ... with txnId 1',
        'code': 251,
        'codeName': 'NoSuchTransaction',
        'errorLabels': ['TransientTransactionError']
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jeff.yemin Jeffrey Yemin
              Reporter:
              jeff.yemin Jeffrey Yemin
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: