[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: |
|
||||||||||||||||||||
| 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: |