24#ifndef GROUP_TRANSACTION_OBSERVATION_MANAGER_INCLUDED
25#define GROUP_TRANSACTION_OBSERVATION_MANAGER_INCLUDED
54 ulong gr_consistency_level,
123 ulong gr_consistency_level, ulong hold_timeout,
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:325
Listener for transaction life cycle events.
Definition: group_transaction_observation_manager.h:33
virtual int before_commit(my_thread_id thread_id, enum_transaction_origin origin)=0
Executed before commit.
virtual int before_transaction_begin(my_thread_id thread_id, ulong gr_consistency_level, ulong hold_timeout, enum_rpl_channel_type channel_type, const THD *thd)=0
Executed before a transaction begins.
virtual int after_commit(my_thread_id thread_id, rpl_sidno sidno, rpl_gno gno)=0
Executed after commit.
enum_transaction_origin
Enum for transaction origins.
Definition: group_transaction_observation_manager.h:36
@ GROUP_APPLIER_TRANSACTION
Definition: group_transaction_observation_manager.h:37
@ GROUP_LOCAL_TRANSACTION
Definition: group_transaction_observation_manager.h:39
@ GROUP_RECOVERY_TRANSACTION
Definition: group_transaction_observation_manager.h:38
virtual ~Group_transaction_listener()
Class destructor.
virtual int after_rollback(my_thread_id thread_id)=0
Executed after rollback.
virtual int before_rollback(my_thread_id thread_id, enum_transaction_origin origin)=0
Executed before rollback.
Definition: group_transaction_observation_manager.h:89
int before_commit(my_thread_id thread_id, Group_transaction_listener::enum_transaction_origin origin)
int before_rollback(my_thread_id thread_id)
void register_transaction_observer(Group_transaction_listener *observer)
Definition: group_transaction_observation_manager.cc:53
void write_lock_observer_list()
Locks the observer list for writes.
Definition: group_transaction_observation_manager.cc:84
void unregister_transaction_observer(Group_transaction_listener *observer)
Definition: group_transaction_observation_manager.cc:62
void read_lock_observer_list()
Locks the observer list for reads.
Definition: group_transaction_observation_manager.cc:80
Group_transaction_observation_manager()
Definition: group_transaction_observation_manager.cc:30
std::atomic< bool > registered_observers
Flag that indicates that there are observers (for performance)
Definition: group_transaction_observation_manager.h:187
int after_commit(my_thread_id thread_id, rpl_sidno sidno, rpl_gno gno)
int after_rollback(my_thread_id thread_id, Group_transaction_listener::enum_transaction_origin origin)
~Group_transaction_observation_manager()
Definition: group_transaction_observation_manager.cc:40
void unlock_observer_list()
Unlocks the observer list.
Definition: group_transaction_observation_manager.cc:88
bool is_any_observer_present()
Are there any observers present.
Definition: group_transaction_observation_manager.cc:92
std::list< Group_transaction_listener * > group_transaction_listeners
List of observers.
Definition: group_transaction_observation_manager.h:181
int before_transaction_begin(my_thread_id thread_id, ulong gr_consistency_level, ulong hold_timeout, enum_rpl_channel_type rpl_channel_type, const THD *thd)
Executed before a transaction begins.
Checkable_rwlock * transaction_observer_list_lock
The lock to protect the list.
Definition: group_transaction_observation_manager.h:184
std::list< Group_transaction_listener * > * get_all_observers()
Get all registered observers.
Definition: group_transaction_observation_manager.cc:72
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Some integer typedefs for easier portability.
static my_thread_id thread_id
Definition: my_thr_init.cc:63
uint32 my_thread_id
Definition: my_thread_local.h:34
enum_rpl_channel_type
Type of replication channel thread/transaction might be associated to.
Definition: rpl_context.h:50
mysql::gtid::gno_t rpl_gno
GNO, the second (numeric) component of a GTID, is an alias of mysql::gtid::gno_t.
Definition: rpl_gtid.h:113
cs::index::rpl_sidno rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:109