24#ifndef XA_SQL_CMD_XA_SECOND_PHASE
25#define XA_SQL_CMD_XA_SECOND_PHASE
Savepoint for MDL context.
Definition: mdl.h:1317
This class abstracts some functionality used by XA statements involved in the second phase of the the...
Definition: sql_xa_second_phase.h:64
void release_locks() const
Release any locks acquires in acquire_locks still needing to be released.
Definition: sql_xa_second_phase.cc:111
MDL_savepoint m_mdl_savepoint
The MDL savepoint used to rollback the MDL context when transient errors occur.
Definition: sql_xa_second_phase.h:79
bool find_and_initialize_xa_context(THD *thd)
Tries to find and initialize the Transaction_ctx for the underlying detached XA transaction.
Definition: sql_xa_second_phase.cc:39
bool m_result
The incremental success of the several initialization and deinitialization steps.
Definition: sql_xa_second_phase.h:88
xid_t * m_xid
The XID associated with the underlying XA transaction.
Definition: sql_xa_second_phase.h:76
Sql_cmd_xa_second_phase(xid_t *xid_arg)
Class constructor.
Definition: sql_xa_second_phase.cc:36
void assign_xid_to_thd(THD *thd) const
Sets the XID_STATE of the THD session object parameter as in detached state and copies into it the XI...
Definition: sql_xa_second_phase.cc:164
void register_xa_recover_finalization_action(THD *thd) const
Register an action that marks the transaction finalized for SQL XA RECOVER before the GTID for the se...
Definition: sql_xa_second_phase.cc:170
bool m_gtid_error
Whether or not the initialization of GTIDs returned an error.
Definition: sql_xa_second_phase.h:83
void exit_commit_order(THD *thd) const
For replica applier threads, finishes the wait on the commit order and allows other threads to procee...
Definition: sql_xa_second_phase.cc:204
virtual ~Sql_cmd_xa_second_phase() override=default
void setup_thd_context(THD *thd)
Initializes the necessary parts of the thd parameter, transferring some of the detached XA transactio...
Definition: sql_xa_second_phase.cc:117
bool m_need_clear_owned_gtid
Whether or not the OWNED_GTID related structures need to be cleaned.
Definition: sql_xa_second_phase.h:85
bool acquire_locks(THD *thd)
Tries to acquire the locks necessary to finalize the underlying detached XA transaction.
Definition: sql_xa_second_phase.cc:52
void cleanup_context(THD *thd, bool remove_from_cache) const
Cleans up the THD context in order to prepare it for re-use.
Definition: sql_xa_second_phase.cc:210
void dispose()
Disposes of member variables that need it, because destructors for Sql_cmd classes aren't invoked (si...
Definition: sql_xa_second_phase.cc:234
std::shared_ptr< Transaction_ctx > m_detached_trx_context
The detached transaction context, retrieved from the transaction cache.
Definition: sql_xa_second_phase.h:81
bool enter_commit_order(THD *thd)
For replica applier threads, enters the wait on the commit order.
Definition: sql_xa_second_phase.cc:144
Representation of an SQL command.
Definition: sql_cmd.h:83
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: transaction_info.h:54
Representation of an SQL command.
struct xid_t is binary compatible with the XID structure as in the X/Open CAE Specification,...
Definition: xa.h:83