-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Programmability
-
Networking & Obs 2024-07-08
TransactionRouter keeps track of a given transactions state and is used to update command requests with the appropriate transaction-related metadata (e.g. txnNumber). It currently provides a few helper functions for this, most notably attachTxnFieldsIfNeeded, appendFieldsForStartTransaction, and appendFieldsForContinueTransaction. However, manipulating BSON directly is error prone (it has very few type-safety guarantees, appending duplicate keys can be easy) and difficult to read/maintain, as well as not being performant (mutating often involves scanning the BSON and reallocating).
Instead, we should update these functions to operate over IDL-generated commands or their GenericArguments structs. This will allow us to write more type safe, performant, and easier-to-maintain code.
- related to
-
SERVER-80526 Refactor appendFieldsForStartTransaction
- Backlog
-
SERVER-85791 Only parse command request once in command processing path
- Closed