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

Move the all transactions-related state from OperationContext to TransactionResources

    • Catalog and Routing
    • 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
    • 3

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: