270#ifdef HAVE_PSI_RWLOCK_INTERFACE
328#ifdef HAVE_PSI_RWLOCK_INTERFACE
352#ifdef HAVE_PSI_RWLOCK_INTERFACE
371#ifdef HAVE_PSI_RWLOCK_INTERFACE
387 my_off_t log_pos,
bool *observe_transmission);
393 const char *skipped_log_file,
my_off_t skipped_log_pos);
397#ifdef HAVE_PSI_RWLOCK_INTERFACE
418 const char **event_buf, ulong *event_len);
420 ulong event_len,
bool synced);
458#define RUN_HOOK(group, hook, args) \
459 (group##_delegate->is_empty() ? 0 : group##_delegate->hook args)
461#define NO_HOOK(group) (group##_delegate->is_empty())
Byte container that provides a storage for serializing session binlog events.
Definition: binlog_ostream.h:174
Definition: rpl_handler.h:401
int applier_start(THD *thd, Master_info *mi)
Definition: rpl_handler.cc:1185
int after_reset_slave(THD *thd, Master_info *mi)
Definition: rpl_handler.cc:1252
int thread_start(THD *thd, Master_info *mi)
Definition: rpl_handler.cc:1163
int applier_log_event(THD *thd, int &out)
Definition: rpl_handler.cc:1265
int applier_stop(THD *thd, Master_info *mi, bool aborted)
Definition: rpl_handler.cc:1196
Binlog_relay_IO_observer Observer
Definition: rpl_handler.h:411
int before_request_transmit(THD *thd, Master_info *mi, ushort flags)
Definition: rpl_handler.cc:1208
void init_param(Binlog_relay_IO_param *param, Master_info *mi)
Definition: rpl_handler.cc:1150
int after_queue_event(THD *thd, Master_info *mi, const char *event_buf, ulong event_len, bool synced)
Definition: rpl_handler.cc:1235
Binlog_relay_IO_delegate()
Definition: rpl_handler.h:403
int after_read_event(THD *thd, Master_info *mi, const char *packet, ulong len, const char **event_buf, ulong *event_len)
Definition: rpl_handler.cc:1220
int thread_stop(THD *thd, Master_info *mi)
Definition: rpl_handler.cc:1174
Definition: rpl_handler.h:356
Binlog_storage_observer Observer
Definition: rpl_handler.h:366
int after_sync(THD *thd, const char *log_file, my_off_t log_pos)
Definition: rpl_handler.cc:1007
Binlog_storage_delegate()
Definition: rpl_handler.h:358
int after_flush(THD *thd, const char *log_file, my_off_t log_pos)
Definition: rpl_handler.cc:890
Definition: rpl_handler.h:375
int before_send_event(THD *thd, ushort flags, String *packet, const char *log_file, my_off_t log_pos)
Definition: rpl_handler.cc:1102
int transmit_stop(THD *thd, ushort flags)
Definition: rpl_handler.cc:1037
int transmit_start(THD *thd, ushort flags, const char *log_file, my_off_t log_pos, bool *observe_transmission)
Definition: rpl_handler.cc:1023
Binlog_transmit_observer Observer
Definition: rpl_handler.h:385
int after_reset_master(THD *thd, ushort flags)
Definition: rpl_handler.cc:1138
int after_send_event(THD *thd, ushort flags, String *packet, const char *skipped_log_file, my_off_t skipped_log_pos)
Definition: rpl_handler.cc:1120
int reserve_header(THD *thd, ushort flags, String *packet)
Definition: rpl_handler.cc:1049
Binlog_transmit_delegate()
Definition: rpl_handler.h:377
Base class for adding replication event observer infra-structure.
Definition: rpl_handler.h:102
bool is_inited()
Returns whether or not this instance was initialized.
Definition: rpl_handler.cc:187
Delegate(PSI_rwlock_key key)
Class constructor.
Definition: rpl_handler.cc:86
int unlock()
Releases this Delegate class instance lock.
Definition: rpl_handler.cc:165
void update_plugin_ref_count()
Increases the info->plugin usage reference counting if replication_optimize_for_static_plugin_config ...
Definition: rpl_handler.cc:198
int read_lock()
Acquires this Delegate class instance lock in read/shared mode.
Definition: rpl_handler.cc:153
int remove_observer(void *observer)
Removes an observer from the observer list.
Definition: rpl_handler.cc:128
int write_lock()
Acquires this Delegate class instance lock in write/exclusive mode.
Definition: rpl_handler.cc:159
lock::Shared_spin_lock m_spin_lock
A shared-exclusive spin lock to be used when optimizing for static plugin config.
Definition: rpl_handler.h:222
bool is_empty()
Returns whether or not there are registered observers.
Definition: rpl_handler.cc:148
MEM_ROOT memroot
Memory pool to be used to allocate the observers list.
Definition: rpl_handler.h:224
Observer_info_list observer_info_list
List of registered observers.
Definition: rpl_handler.h:213
enum_delegate_lock_type
Definition: rpl_handler.h:245
@ DELEGATE_OS_LOCK
Definition: rpl_handler.h:246
@ DELEGATE_SPIN_LOCK
Definition: rpl_handler.h:247
bool use_spin_lock_type()
Returns whether or not to use the shared spin-lock.
Definition: rpl_handler.cc:233
bool inited
Flag statign whether or not this instance was initialized.
Definition: rpl_handler.h:226
void lock_it(enum_delegate_lock_mode mode)
Locks the active lock (OS read-write lock or shared spin-lock) according to the mode passed on as a p...
Definition: rpl_handler.cc:250
List_iterator< Observer_info > Observer_info_iterator
Definition: rpl_handler.h:105
void update_lock_type()
Toggles the type of lock between a classical read-write lock and a shared-exclusive spin-lock.
Definition: rpl_handler.cc:189
std::atomic< int > m_acquired_locks
The count of locks acquired: -1 will be added for each classic read-write lock acquisitions; +1 will ...
Definition: rpl_handler.h:237
virtual ~Delegate()
Class destructor.
Definition: rpl_handler.cc:104
Observer_info_iterator observer_info_iter()
Retrieves an iterator for the observer list.
Definition: rpl_handler.cc:144
mysql_rwlock_t lock
A read/write lock to be used when not optimizing for static plugin config.
Definition: rpl_handler.h:217
std::atomic< int > m_configured_lock_type
The type of lock configured to be used, either a classic read-write (-1) lock or a shared-exclusive s...
Definition: rpl_handler.h:231
enum_delegate_lock_mode
Definition: rpl_handler.h:250
@ DELEGATE_LOCK_MODE_SHARED
Definition: rpl_handler.h:251
@ DELEGATE_LOCK_MODE_EXCLUSIVE
Definition: rpl_handler.h:252
int add_observer(void *observer, st_plugin_int *plugin)
Adds an observer to the observer list.
Definition: rpl_handler.cc:109
bool use_rw_lock_type()
Returns whether or not to use the classic read-write lock.
Definition: rpl_handler.cc:221
List< Observer_info > Observer_info_list
Definition: rpl_handler.h:104
std::map< plugin_ref, size_t > m_acquired_references
List of acquired plugin references, to be held while replication_optimize_for_static_plugin_config op...
Definition: rpl_handler.h:243
void acquire_plugin_ref_count(Observer_info *info)
Increases the info->plugin reference counting and stores that reference internally.
Definition: rpl_handler.cc:245
Definition: sql_list.h:573
Definition: rpl_handler.h:87
void * observer
Definition: rpl_handler.h:89
Observer_info(void *ob, st_plugin_int *p)
Definition: rpl_handler.cc:81
plugin_ref plugin
Definition: rpl_handler.h:91
st_plugin_int * plugin_int
Definition: rpl_handler.h:90
Definition: rpl_handler.h:332
Server_state_observer Observer
Definition: rpl_handler.h:342
int after_server_shutdown(THD *thd)
This hook MUST be invoked after server shutdown operation is complete.
Definition: rpl_handler.cc:984
int before_handle_connection(THD *thd)
This hook MUST be invoked after ALL recovery operations are performed and the server is ready to serv...
Definition: rpl_handler.cc:909
int before_server_shutdown(THD *thd)
This hook MUST be invoked before server shutdown action is initiated.
Definition: rpl_handler.cc:969
Server_state_delegate()
Definition: rpl_handler.h:334
int after_engine_recovery(THD *thd)
This hook MUST be invoked after the recovery from the engine is complete.
Definition: rpl_handler.cc:938
int after_recovery(THD *thd)
This hook MUST be invoked after the server has completed the local recovery.
Definition: rpl_handler.cc:954
int before_recovery(THD *thd)
This hook MUST be invoked before ANY recovery action is started.
Definition: rpl_handler.cc:923
int after_dd_upgrade_from_57(THD *thd)
This hook MUST be invoked after upgrade from .frm to data dictionary.
Definition: rpl_handler.cc:998
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Definition: rpl_handler.h:276
Trans_delegate()
Definition: rpl_handler.h:281
int after_rollback(THD *thd, bool all)
Definition: rpl_handler.cc:823
int set_no_restrictions_at_transactions_before_commit()
Method that allows the transactions to commit again which were earlier stopped by set_transactions_no...
Definition: rpl_handler.cc:884
int before_dml(THD *thd, int &result)
Definition: rpl_handler.cc:740
std::atomic< bool > m_rollback_transaction_not_reached_before_commit
Definition: rpl_handler.h:278
int set_transactions_at_begin_must_fail()
The method sets the flag that will fail the new incoming transactions and allows some management quer...
Definition: rpl_handler.cc:866
int trans_begin(THD *thd, int &result)
Definition: rpl_handler.cc:842
int after_commit(THD *thd, bool all)
Definition: rpl_handler.cc:793
int before_rollback(THD *thd, bool all)
Definition: rpl_handler.cc:766
int set_no_restrictions_at_transaction_begin()
The method that removes the restrictions on the transactions which were earlier failing due to flag s...
Definition: rpl_handler.cc:872
Trans_observer Observer
Definition: rpl_handler.h:289
std::atomic< bool > m_rollback_transaction_on_begin
Definition: rpl_handler.h:277
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_co...
Definition: rpl_handler.cc:878
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)
Definition: rpl_handler.cc:542
Definition: shared_spin_lock.h:80
const char * p
Definition: ctype-mb.cc:1237
bool is_atomic_ddl(THD *thd, bool using_trans_arg)
The function lists all DDL instances that are supported for crash-recovery (WL9175).
Definition: log_event.cc:3732
unsigned int PSI_rwlock_key
Instrumented rwlock key.
Definition: psi_rwlock_bits.h:44
static int flags[50]
Definition: hp_test1.cc:40
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
ulonglong my_off_t
Definition: my_inttypes.h:72
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
#define HAVE_PSI_RWLOCK_INTERFACE
Definition: my_psi_config.h:84
Common header for many mysys elements.
Instrumentation helpers for rwlock.
Logfile log_file
Definition: mysqltest.cc:263
mode
Definition: file_handle.h:60
Instrumentation helpers for rwlock.
PSI_memory_key key_memory_delegate
Definition: psi_memory_key.cc:105
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
void delegates_release_locks()
Releases locks for all the observer delegate objects.
Definition: rpl_handler.cc:431
PSI_rwlock_key key_rwlock_Trans_delegate_lock
Definition: mysqld.cc:11952
Binlog_storage_delegate * binlog_storage_delegate
Definition: rpl_handler.cc:72
Trans_delegate * transaction_delegate
Definition: rpl_handler.cc:71
Binlog_transmit_delegate * binlog_transmit_delegate
Definition: rpl_handler.cc:75
int delegates_init()
Definition: rpl_handler.cc:353
PSI_rwlock_key key_rwlock_Binlog_storage_delegate_lock
Definition: mysqld.cc:11954
PSI_rwlock_key key_rwlock_Binlog_relay_IO_delegate_lock
Definition: mysqld.cc:11956
PSI_rwlock_key key_rwlock_Server_state_delegate_lock
Definition: mysqld.cc:11953
Binlog_relay_IO_delegate * binlog_relay_io_delegate
Definition: rpl_handler.cc:76
Server_state_delegate * server_state_delegate
Definition: rpl_handler.cc:73
void delegates_update_lock_type()
Toggles the type of lock between a classical read-write lock and a shared-exclusive spin-lock.
Definition: rpl_handler.cc:439
std::atomic< bool > opt_replication_sender_observe_commit_only
Variable to keep the value set for the replication_sender_observe_commit_only global.
Definition: rpl_handler.cc:79
int launch_hook_trans_begin(THD *thd, Table_ref *table)
Definition: rpl_handler.cc:1373
bool opt_replication_optimize_for_static_plugin_config
Variable to keep the value set for the replication_optimize_for_static_plugin_config global.
Definition: rpl_handler.cc:78
void delegates_shutdown()
Verify that the replication plugins are ready and OK to be unloaded.
Definition: rpl_handler.cc:392
void delegates_destroy()
Definition: rpl_handler.cc:401
void delegates_acquire_locks()
Invokes write_lock() for all the observer delegate objects.
Definition: rpl_handler.cc:423
PSI_rwlock_key key_rwlock_Binlog_transmit_delegate_lock
Definition: mysqld.cc:11955
Observes and extends the service of slave IO thread.
Definition: replication.h:730
Replication binlog relay IO observer parameter.
Definition: replication.h:594
Observe binlog logging storage.
Definition: replication.h:442
Observe and extends the binlog dumping thread.
Definition: replication.h:572
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Observer server state.
Definition: replication.h:402
Observes and extends transaction execution.
Definition: replication.h:298
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:51
Definition: sql_plugin_ref.h:45
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:872