[SERVER-64104] Advance TransactionRouter firstStmtId on continue if no participants were targeted Created: 02/Mar/22  Updated: 29/Oct/23  Resolved: 15/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Jack Mulrow Assignee: [DO NOT USE] Backlog - Sharding NYC
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding NYC
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2022-07-25
Participants:

 Description   

The TransactionRouter tracks the statement number of the first command it received and increments its notion of the current statement whenever the transaction is continued. There are behaviors conditional on if the current statement is the first overall, like retrying on certain stale config errors.

If the transaction API is used on a mongos within a client transaction, the API's first recursive command will continue the TransactionRouter transaction started by the client so despite that command likely being the first that could target a participant, the router will have opted out of all first overall statement behaviors.

Since the API will be a common use case going forward, we should enable those behaviors by having the TransactionRouter track the first statement number to actually target a participant, instead of the first overall. This can be accomplished by checking if the participant list is non-empty before incrementing the latestStmtId. 



 Comments   
Comment by Githook User [ 14/Jul/22 ]

Author:

{'name': 'Erin Liang', 'email': 'erin.liang@mongodb.com', 'username': 'erl-ang'}

Message: SERVER-64104: Advance TransactionRouter firstStmtId on continue if no participants were targeted
Branch: master
https://github.com/mongodb/mongo/commit/bc7d24c035466c435ade89b62f958a6fa4e22333

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