Manipulate IDL-generated structs instead of BSONObjs in TransactionRouter

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • Networking & Obs 2024-07-08
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Unassigned
              Reporter:
              Patrick Freed
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: