[SERVER-77213] Move the all transactions-related state from OperationContext to TransactionResources Created: 17/May/23 Updated: 01/Feb/24 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Kaloian Manassiev | Assignee: | Backlog - Catalog and Routing |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | PM-2144-QW-Fallout, shardingemea-qw | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Assigned Teams: |
Catalog and Routing
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Sharding EMEA 2023-05-29, Sharding EMEA 2023-06-12, Sharding EMEA 2023-06-26, Sharding EMEA 2023-07-10, Sharding EMEA 2023-10-02, Sharding EMEA 2023-10-16, Sharding EMEA 2023-10-30, CAR Team 2023-11-13, CAR Team 2023-11-27, CAR Team 2023-12-11, CAR Team 2023-12-25, CAR Team 2024-01-08 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Story Points: | 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
The TransactionResources class is becoming the sole data structure which will hold all kinds of resources that can be acquired by an active transaction, where transaction is defined as per this description. We will be moving in the way where the transaction resources is what gets moved between contexts rather than swapping each individual resource (listed below) independently. This ticket is specifically to move the Txn identification, Locker, RecoveryUnit and WriteUnitOfWork state from OperationContext to TransactionResources and remove all traces of it from OperationContext. This will also resolve circular dependency between the service_context library and the rest of the server, leaving it to be a low-level library for building any service. As part of this change, we should also revisit all the swap* and replace* methods and how they are used. My interpretation is that they are used to implement various types of sub-transactions as part of the active one. For example, there is a sub-transaction kind, where we only replace the RecoveryUnit, but maintain the locks, which we call "Side Transaction". There are probably others and all these should be replaced by proper RAII types that operate on TransactionResources. |
| Comments |
| Comment by Kaloian Manassiev [ 20/Sep/23 ] |
|
This ticket is a subset of the changes that will be done under |
| Comment by Jordi Serra Torrens [ 30/Aug/23 ] |
|
As part of this ticket, consider moving WriteUnitOfWork from opCtx to TransactionResources as well. |