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

Allow prepared transaction statements to persist in-memory until commit



    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 4.1.6
    • Fix Version/s: 4.1.8
    • Component/s: Replication
    • Labels:


      Problem Summary

      We would like to be able to observe all statements on transaction commit. This is so that migrations may take these statements on commit and add them to any current transferMods queue.

      Currently, for prepared transactions, we discard statements on prepare, and don't persist these statements until commit time.

      Proposed Approach

      We will have to make changes to the transaction participant in order to persist these statements.

      • A new method retrieveOperations() will simply retrieve and return a reference to _transactionOperations. This method will require that the session is checked out, and that it is only called after the transaction has been prepared.
      • A new method endTransactionAndClearOperationsInMemory() will clear the _transactionOperations variable and set _transactionOperationBytes to zero.
      • The current usage of the method endTransactionAndRetrieveOperations() will be replaced with retrieveOperations() when we want the operations, combined with endTransactionAndClearOperationsInMemory() when we want to clear the transaction memory on commit.
      • Prepared transactions will no longer call endTransactionAndRetrieveOperations() on prepare. They will call both retrieveOperations() and endTransactionAndClearOperationsInMemory() on commit.
      • Non-prepared transactions will continue to persist the previous behavior of the previous method, calling both retrieveOperationsFor() and endTransactionAndClearOperationsInMemory() on commit.

      NOTE: We have renamed retrieveOperationsForMigrate() to retrieveOperations(), because we have identified usage of said operations outside of migrate, including here.


          Issue Links



              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created: