-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
The internal transaction API accepts command arguments in a number of different forms. Two methods, runCommand and runCommandChecked, accept their commands as BSONObjs, and they are the basis for the implementation of the other runCommand-overloads. The implementation of these methods checks for the presence of and appends many different transaction-related fields to the request document, and this involves many linear scans of the BSON and reallocations of the document, which is error prone and not performant.
Instead, we should replace these methods with ones that accept IDL-generated command structs instead, as this will let the implementation inspect/modify these fields without doing expensive lookups. This is possible now that all IDL-generated commands include generic arguments (e.g. txnNumber), which was introduced in SERVER-85791.
From a quick look, many of the existing usages of the internal transaction API pass in MyIdlStruct.toBSON() to these methods, so replacing them should be fairly straightforward.
- is related to
-
SERVER-90757 Remove transaction validation wrappers isRetryableWriteCommand() and isTransactionCommand()
- Open
-
SERVER-91316 Accept command struct arguments instead of BSONObjs in Shard API
- Backlog
- related to
-
SERVER-85791 Only parse command request once in command processing path
- Closed
-
SERVER-90823 Replace usages of BSON-manipulating generic argument helper functions with generic_argument_util equivalents
- Closed