[SERVER-61088] [Upgrade/downgrade] Make transaction participants check if txnRetryCounter is supported during startTransaction and have mongos use it Created: 28/Oct/21  Updated: 29/Oct/23  Resolved: 03/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Task Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Jason Zhang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-61085 [Upgrade/downgrade] Do not persist tx... Closed
is depended on by SERVER-61089 [Upgrade/downgrade] Make mongos use s... Closed
Duplicate
is duplicated by SERVER-61089 [Upgrade/downgrade] Make mongos use s... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-12-27, Sharding 2022-01-10, Sharding 2022-01-24, Sharding 2022-02-07
Participants:
Story Points: 3

 Description   
  • 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.

Then:

  • 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.


 Comments   
Comment by Githook User [ 03/Feb/22 ]

Author:

{'name': 'Jason Zhang', 'email': 'jason.zhang@mongodb.com', 'username': 'jz1242'}

Message: SERVER-61088 Make transaction participants check if txnRetryCounter is supported during startTransaction and have mongos use it
Branch: master
https://github.com/mongodb/mongo/commit/0e4e2c4a28fee3358ff2f0f0f102f0e8b59185d0

Generated at Thu Feb 08 05:51:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.