[SERVER-64070] Clean up startTransaction handling for transaction API in client transaction case Created: 01/Mar/22  Updated: 29/Oct/23  Resolved: 08/Mar/22

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

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

Issue Links:
Related
is related to SERVER-59186 [API] Use internal transaction API fo... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2022-03-07
Participants:

 Description   

Currently, the transaction API will never inject `startTransaction:true` or other "first transaction command" options (e.g. read/write concern) into a command in its client execution context. This works when the API is used by commands that aren't the first in their transaction, but is inconvenient when the command sent by the API actually will be the first sent for its client transaction, since the caller would need to manually include the start transaction options. Instead the API should infer this context based on the result of isStartingMultiDocumentTransaction() / isContinuingMultiDocumentTransaction() from the callers opCtx.

Additionally, we should add full unit test coverage for all logic branches in the API for the client transaction case, to supplement the integration coverage from SERVER-59186.



 Comments   
Comment by Githook User [ 08/Mar/22 ]

Author:

{'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}

Message: SERVER-64070 Clean up startTransaction handling for transaction API client transaction case
Branch: master
https://github.com/mongodb/mongo/commit/27fcf5589c48d1f5a7d91c3ba99ebe168d9859bf

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