Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-61088

[Upgrade/downgrade] Make transaction participants check if txnRetryCounter is supported during startTransaction and have mongos use it

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • Sharding 2021-12-27, Sharding 2022-01-10, Sharding 2022-01-24, Sharding 2022-02-07
    • 3

      • Make transaction participants do the following upon receiving a startTransaction statement with a txnRetryCounter:
        • If the FCV is latest and the feature flag is enabled, attach supportTxnRetryCounter:true to the response to the startTransaction statement. After that, the transaction must continue to use that txnRetryCounter regardless of FCV or feature flag changes. 
        • Otherwise, attach supportTxnRetryCounter:false to the response for the statement if txnRetryCounter=0, or throw a TxnRetryCounterNotSupported error if txnRetryCounter>0.
      • Remove InvalidOptions uassert for txnRetryCounter from initializeOperationSessionInfo().
      • Remove the feature flag checks in op_observer_impl.cpp and transaction_coordinator_util.cpp, and make it such that txnRetryCounter is written to config.transactions and config.transaction_coordinators entries and transaction oplog entries if and only if it is initialized.


      • Make mongos use the flag to determine if txnRetryCounter should be attached in future transaction statements.
      • Add TxnRetryCounterNotSupported to the list of transient transaction errors so that mongos attaches the TransientTransactionError label to the response to the command in the transaction that was internally retried with a non-zero txnRetryCounter.

            jason.zhang@mongodb.com Jason Zhang
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            0 Vote for this issue
            2 Start watching this issue