MySQL 9.0.0
Source Code Documentation
Trans_delegate Class Reference

#include <rpl_handler.h>

Inheritance diagram for Trans_delegate:
[legend]

Public Types

typedef Trans_observer Observer
 
- Public Types inherited from Delegate
typedef List< Observer_infoObserver_info_list
 
typedef List_iterator< Observer_infoObserver_info_iterator
 

Public Member Functions

 Trans_delegate ()
 
int before_dml (THD *thd, int &result)
 
int before_commit (THD *thd, bool all, Binlog_cache_storage *trx_cache_log, Binlog_cache_storage *stmt_cache_log, ulonglong cache_log_max_size, bool is_atomic_ddl)
 
int before_rollback (THD *thd, bool all)
 
int after_commit (THD *thd, bool all)
 
int after_rollback (THD *thd, bool all)
 
int trans_begin (THD *thd, int &result)
 
int set_transactions_at_begin_must_fail ()
 The method sets the flag that will fail the new incoming transactions and allows some management queries to run. More...
 
int set_no_restrictions_at_transaction_begin ()
 The method that removes the restrictions on the transactions which were earlier failing due to flag set by the set_transactions_at_begin_must_fail method. More...
 
int set_transactions_not_reached_before_commit_must_fail ()
 Method to rollback the transactions that passed the begin state but have yet not reached the begin_commit stage. More...
 
int set_no_restrictions_at_transactions_before_commit ()
 Method that allows the transactions to commit again which were earlier stopped by set_transactions_not_reached_before_commit_must_fail method. More...
 
- Public Member Functions inherited from Delegate
 Delegate (PSI_rwlock_key key)
 Class constructor. More...
 
virtual ~Delegate ()
 Class destructor. More...
 
int add_observer (void *observer, st_plugin_int *plugin)
 Adds an observer to the observer list. More...
 
int remove_observer (void *observer)
 Removes an observer from the observer list. More...
 
Observer_info_iterator observer_info_iter ()
 Retrieves an iterator for the observer list. More...
 
bool is_empty ()
 Returns whether or not there are registered observers. More...
 
int read_lock ()
 Acquires this Delegate class instance lock in read/shared mode. More...
 
int write_lock ()
 Acquires this Delegate class instance lock in write/exclusive mode. More...
 
int unlock ()
 Releases this Delegate class instance lock. More...
 
bool is_inited ()
 Returns whether or not this instance was initialized. More...
 
void update_lock_type ()
 Toggles the type of lock between a classical read-write lock and a shared-exclusive spin-lock. More...
 
void update_plugin_ref_count ()
 Increases the info->plugin usage reference counting if replication_optimize_for_static_plugin_config is being enabled, in order to prevent plugin removal. More...
 
bool use_rw_lock_type ()
 Returns whether or not to use the classic read-write lock. More...
 
bool use_spin_lock_type ()
 Returns whether or not to use the shared spin-lock. More...
 

Private Attributes

std::atomic< bool > m_rollback_transaction_on_begin {false}
 
std::atomic< bool > m_rollback_transaction_not_reached_before_commit {false}
 

Member Typedef Documentation

◆ Observer

Constructor & Destructor Documentation

◆ Trans_delegate()

Trans_delegate::Trans_delegate ( )
inline

Member Function Documentation

◆ after_commit()

int Trans_delegate::after_commit ( THD thd,
bool  all 
)

◆ after_rollback()

int Trans_delegate::after_rollback ( THD thd,
bool  all 
)

◆ before_commit()

int Trans_delegate::before_commit ( THD thd,
bool  all,
Binlog_cache_storage trx_cache_log,
Binlog_cache_storage stmt_cache_log,
ulonglong  cache_log_max_size,
bool  is_atomic_ddl 
)

If thread is killed or commits are blocked do not commit the transaction. Post this thread cannot be killed.

Disconnect the client connection if not already done. Do not KILL connection if the transaction is going to be rolledback.

◆ before_dml()

int Trans_delegate::before_dml ( THD thd,
int &  result 
)

◆ before_rollback()

int Trans_delegate::before_rollback ( THD thd,
bool  all 
)

◆ set_no_restrictions_at_transaction_begin()

int Trans_delegate::set_no_restrictions_at_transaction_begin ( )

The method that removes the restrictions on the transactions which were earlier failing due to flag set by the set_transactions_at_begin_must_fail method.

◆ set_no_restrictions_at_transactions_before_commit()

int Trans_delegate::set_no_restrictions_at_transactions_before_commit ( )

Method that allows the transactions to commit again which were earlier stopped by set_transactions_not_reached_before_commit_must_fail method.

◆ set_transactions_at_begin_must_fail()

int Trans_delegate::set_transactions_at_begin_must_fail ( )

The method sets the flag that will fail the new incoming transactions and allows some management queries to run.

New incoming transactions are rolled back.

◆ set_transactions_not_reached_before_commit_must_fail()

int Trans_delegate::set_transactions_not_reached_before_commit_must_fail ( )

Method to rollback the transactions that passed the begin state but have yet not reached the begin_commit stage.

Transactions are not allowed to broadcast instead failure is returned from before_commit function.

◆ trans_begin()

int Trans_delegate::trans_begin ( THD thd,
int &  result 
)

Member Data Documentation

◆ m_rollback_transaction_not_reached_before_commit

std::atomic<bool> Trans_delegate::m_rollback_transaction_not_reached_before_commit {false}
private

◆ m_rollback_transaction_on_begin

std::atomic<bool> Trans_delegate::m_rollback_transaction_on_begin {false}
private

The documentation for this class was generated from the following files: