Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-69478

remove unnecessary copy in TransactionParticipant::commitUnpreparedTransaction()

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

      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@mongodb.com Benety Goh
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: