Skip to content
  • Dmitry Shulga's avatar
    cfd4f5c0
    WL#9335 Enable MDL Locking for Recovered and Detached Prepared · cfd4f5c0
    Dmitry Shulga authored
    XA Transactions
    
    Summary:
    This WL creates new backup meachnism to hold MDL locks when
    there is no active THD object associated with it. The following
    use cases are covered by this new mdl backup subsystem.
    
    When a client connection is broken/ends after making a
    PREPARED XA transaction, transaction goes into detached
    state and stays in XA transaction cache. MDL locks associated
    with such transactions are transferred to MDL backup subsystem.
    Backedup MDL locks will be freed once the transaction is
    finished from another connection by subsequent XA COMMIT or
    XA ROLLBACK.
    
    When server goes down(graceful or crash) after XA transaction
    moved to PREPARED state, Innodb recovers such XA transactions during
    server start and puts the transaction in server's XA transaction
    cache. Relevant MDL locks are taken during the same time and added
    to MDL backup subsystem to protect participating table(s) from DDL(s).
    Backedup MDL locks will be freed once the transaction is finished from
    another connection by subsequent XA COMMIT or XA ROLLBACK.
    
    Additionally, refactoring was done as part of worklog implementation to
    extract code used for commit/roll back of prepared XA transaction
    into separate methods (extract method refactoring). Both branches used for
    handling of external and internal transaction branches were refactored.
    cfd4f5c0
    WL#9335 Enable MDL Locking for Recovered and Detached Prepared
    Dmitry Shulga authored
    XA Transactions
    
    Summary:
    This WL creates new backup meachnism to hold MDL locks when
    there is no active THD object associated with it. The following
    use cases are covered by this new mdl backup subsystem.
    
    When a client connection is broken/ends after making a
    PREPARED XA transaction, transaction goes into detached
    state and stays in XA transaction cache. MDL locks associated
    with such transactions are transferred to MDL backup subsystem.
    Backedup MDL locks will be freed once the transaction is
    finished from another connection by subsequent XA COMMIT or
    XA ROLLBACK.
    
    When server goes down(graceful or crash) after XA transaction
    moved to PREPARED state, Innodb recovers such XA transactions during
    server start and puts the transaction in server's XA transaction
    cache. Relevant MDL locks are taken during the same time and added
    to MDL backup subsystem to protect participating table(s) from DDL(s).
    Backedup MDL locks will be freed once the transaction is finished from
    another connection by subsequent XA COMMIT or XA ROLLBACK.
    
    Additionally, refactoring was done as part of worklog implementation to
    extract code used for commit/roll back of prepared XA transaction
    into separate methods (extract method refactoring). Both branches used for
    handling of external and internal transaction branches were refactored.
Loading