MySQL 9.1.0
Source Code Documentation
|
This class servers as a registry for prepared XA transactions existed before server was shutdown and being resurrected during the server restart. More...
#include <xa.h>
Public Member Functions | |
bool | add_prepared_xa_transaction (XA_recover_txn const *prepared_xa_trn) |
Add information about prepared XA transaction into a list of XA transactions to resurrect. More... | |
bool | recover_prepared_xa_transactions () |
Iterate along a list of prepared XA transactions, register every XA transaction in a cache and acquire MDL locks for every table taking part in XA transaction being resurrected. More... | |
MEM_ROOT * | get_allocated_memroot () |
Get initialized MEM_ROOT. More... | |
Static Public Member Functions | |
static bool | init () |
Initialize singleton. More... | |
static void | destroy () |
Cleanup and delete singleton object. More... | |
static Recovered_xa_transactions & | instance () |
Get instance of the class Recovered_xa_transactions. More... | |
Private Member Functions | |
Recovered_xa_transactions () | |
Private Attributes | |
std::list< XA_recover_txn *, Malloc_allocator< XA_recover_txn * > > | m_prepared_xa_trans |
bool | m_mem_root_inited |
MEM_ROOT | m_mem_root |
Static Private Attributes | |
static Recovered_xa_transactions * | m_instance = nullptr |
This class servers as a registry for prepared XA transactions existed before server was shutdown and being resurrected during the server restart.
The class is singleton. To collect a list of XA transaction identifiers and a list of tables for that MDL locks have be acquired the method add_prepared_xa_transaction() must be called. This method is invoked by the function trx_recover_for_mysql() called by innobase_xa_recover during running of X/Open XA distributed transaction recovery procedure. After a list of XA transaction identifiers and a list of table names to be locked in MDL have been collected and the function ha_recover() has returned control flow the method recover_prepared_xa_transactions() must be called to resurrect prepared XA transactions. Separation of collecting information about prepared XA transactions from restoring XA transactions is done in order to exclude possible suspending on MDL locks inside the function dd::reset_tables_and_tablespaces() that is called right after the function ha_recover() returns control flow.
|
private |
bool Recovered_xa_transactions::add_prepared_xa_transaction | ( | XA_recover_txn const * | prepared_xa_trn | ) |
Add information about prepared XA transaction into a list of XA transactions to resurrect.
prepared_xa_trn | information about prepared XA transaction |
|
static |
Cleanup and delete singleton object.
MEM_ROOT * Recovered_xa_transactions::get_allocated_memroot | ( | ) |
Get initialized MEM_ROOT.
|
static |
Initialize singleton.
|
static |
Get instance of the class Recovered_xa_transactions.
bool Recovered_xa_transactions::recover_prepared_xa_transactions | ( | ) |
Iterate along a list of prepared XA transactions, register every XA transaction in a cache and acquire MDL locks for every table taking part in XA transaction being resurrected.
|
staticprivate |
|
private |
|
private |
|
private |