[SERVER-69478] remove unnecessary copy in TransactionParticipant::commitUnpreparedTransaction() Created: 06/Sep/22  Updated: 29/Oct/23  Resolved: 06/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-69560 change return type of TransactionPart... Closed
is related to SERVER-45806 Record pre-images on updates and dele... Closed
is related to SERVER-38906 Multi-document transactions should no... Closed
is related to SERVER-39017 Allow prepared transaction statements... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-09-19
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 06/Sep/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-69478 avoid copying completed transaction ops in commitUnpreparedTransactionOperation()
Branch: master
https://github.com/mongodb/mongo/commit/90b73b73949722ef92872bf2ca733e6906984b7c

Generated at Thu Feb 08 06:13:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.