[SERVER-63491] Handle txnRetryCounter entirely within TransactionRouter Created: 09/Feb/22  Updated: 29/Oct/23  Resolved: 28/Feb/22

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

Type: Task Priority: Major - P3
Reporter: Jack Mulrow Assignee: Sanika Phanse (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2022-02-21, Sharding 2022-03-07
Participants:

 Description   

The txnRetryCounter field added for internal transactions is only necessary for retrying transparently within a client transaction (tracked by SERVER-60369), so there's no need for callers to pass one to TransactionRouter::beginOrContinueTxn() on mongos and retry counter handling can take place entirely within that class.



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

Author:

{'name': 'Sanika Phanse', 'email': 'sanika.phanse@mongodb.com', 'username': 'sphanse99'}

Message: SERVER-63491 Remove TxnNumberAndRetryCounter as a parameter for txnRouter.beginOrContinue()
Branch: master
https://github.com/mongodb/mongo/commit/d85d3a3df471fbbf29459e37937161b0b55c3230

Comment by Jack Mulrow [ 09/Feb/22 ]

Proposed implementation:

  1. Change TransactionRouter::beginOrContinueTxn() to take a TxnNumber here instead of a TxnNumberAndRetryCounter and instead construct a TxnNumberAndRetryCounter within the method with a retry counter of 0.
  2. Remove the existing txnRetryCounter validations in beginOrContinueTxn(), e.g. this invariant, this if block, and this else if condition.
  3. Update tests that send a txnRetryCounter directly to a mongos (as opposed to against a mongod, which will still be supported) or TransactionRouter::beginOrContinueTxn(), to not do so.
Generated at Thu Feb 08 05:57:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.