remove unnecessary copy in TransactionParticipant::commitUnpreparedTransaction()

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Execution Team 2022-09-19
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This copy operation can be replaced with a mutable reference to the container of replication operations.

      Compare with this usage of TransactionParticipant::retrieveCompletedTransactionOperations() in TransactionParticipant::prepareTransaction()|https://github.com/mongodb/mongo/blob/2b958166154c99dc554591d57ce44caee35cb446/src/mongo/db/transaction/transaction_participant.cpp#L1600].

      Storing a mutable reference to the completed operations is preferable because the caller is responsible for clearing the in-memory operations using clearOperationsInMemory. Additionally, the OpObserver interfaces are declared to accept a pointer to the vectory of ReplOperations.

              Assignee:
              Benety Goh
              Reporter:
              Benety Goh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: