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:1191
int after_reset_slave(THD *thd, Master_info *mi)
Definition: rpl_handler.cc:1258
int thread_start(THD *thd, Master_info *mi)
Definition: rpl_handler.cc:1169
int applier_log_event(THD *thd, int &out)
Definition: rpl_handler.cc:1271
int applier_stop(THD *thd, Master_info *mi, bool aborted)
Definition: rpl_handler.cc:1202
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:1214
void init_param(Binlog_relay_IO_param *param, Master_info *mi)
Definition: rpl_handler.cc:1156
int after_queue_event(THD *thd, Master_info *mi, const char *event_buf, ulong event_len, bool synced)
Definition: rpl_handler.cc:1241
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:1226
int thread_stop(THD *thd, Master_info *mi)
Definition: rpl_handler.cc:1180
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:1013
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:896
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:1108
int transmit_stop(THD *thd, ushort flags)
Definition: rpl_handler.cc:1043
int transmit_start(THD *thd, ushort flags, const char *log_file, my_off_t log_pos, bool *observe_transmission)
Definition: rpl_handler.cc:1029
Binlog_transmit_observer Observer
Definition: rpl_handler.h:385
int after_reset_master(THD *thd, ushort flags)
Definition: rpl_handler.cc:1144
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:1126
int reserve_header(THD *thd, ushort flags, String *packet)
Definition: rpl_handler.cc:1055
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:188
Delegate(PSI_rwlock_key key)
Class constructor.
Definition: rpl_handler.cc:87
int unlock()
Releases this Delegate class instance lock.
Definition: rpl_handler.cc:166
void update_plugin_ref_count()
Increases the info->plugin usage reference counting if replication_optimize_for_static_plugin_config ...
Definition: rpl_handler.cc:199
int read_lock()
Acquires this Delegate class instance lock in read/shared mode.
Definition: rpl_handler.cc:154
int remove_observer(void *observer)
Removes an observer from the observer list.
Definition: rpl_handler.cc:129
int write_lock()
Acquires this Delegate class instance lock in write/exclusive mode.
Definition: rpl_handler.cc:160
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:149
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:234
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:251
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:190
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:105
Observer_info_iterator observer_info_iter()
Retrieves an iterator for the observer list.
Definition: rpl_handler.cc:145
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:110
bool use_rw_lock_type()
Returns whether or not to use the classic read-write lock.
Definition: rpl_handler.cc:222
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:246
Definition: sql_list.h:633
Definition: rpl_handler.h:87
void * observer
Definition: rpl_handler.h:89
Observer_info(void *ob, st_plugin_int *p)
Definition: rpl_handler.cc:82
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:990
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:915
int before_server_shutdown(THD *thd)
This hook MUST be invoked before server shutdown action is initiated.
Definition: rpl_handler.cc:975
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:944
int after_recovery(THD *thd)
This hook MUST be invoked after the server has completed the local recovery.
Definition: rpl_handler.cc:960
int before_recovery(THD *thd)
This hook MUST be invoked before ANY recovery action is started.
Definition: rpl_handler.cc:929
int after_dd_upgrade_from_57(THD *thd)
This hook MUST be invoked after upgrade from .frm to data dictionary.
Definition: rpl_handler.cc:1004
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: rpl_handler.h:276
Trans_delegate()
Definition: rpl_handler.h:281
int after_rollback(THD *thd, bool all)
Definition: rpl_handler.cc:828
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:890
int before_dml(THD *thd, int &result)
Definition: rpl_handler.cc:741
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:872
int trans_begin(THD *thd, int &result)
Definition: rpl_handler.cc:847
int after_commit(THD *thd, bool all)
Definition: rpl_handler.cc:794
int before_rollback(THD *thd, bool all)
Definition: rpl_handler.cc:767
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:878
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:884
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:545
Definition: shared_spin_lock.h:80
const char * p
Definition: ctype-mb.cc:1225
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:3749
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:86
Common header for many mysys elements.
Instrumentation helpers for rwlock.
Logfile log_file
Definition: mysqltest.cc:269
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
mode
Definition: file_handle.h:61
Instrumentation helpers for rwlock.
PSI_memory_key key_memory_delegate
Definition: psi_memory_key.cc:110
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:432
PSI_rwlock_key key_rwlock_Trans_delegate_lock
Definition: mysqld.cc:13886
Binlog_storage_delegate * binlog_storage_delegate
Definition: rpl_handler.cc:73
Trans_delegate * transaction_delegate
Definition: rpl_handler.cc:72
Binlog_transmit_delegate * binlog_transmit_delegate
Definition: rpl_handler.cc:76
int delegates_init()
Definition: rpl_handler.cc:354
PSI_rwlock_key key_rwlock_Binlog_storage_delegate_lock
Definition: mysqld.cc:13888
PSI_rwlock_key key_rwlock_Binlog_relay_IO_delegate_lock
Definition: mysqld.cc:13890
PSI_rwlock_key key_rwlock_Server_state_delegate_lock
Definition: mysqld.cc:13887
Binlog_relay_IO_delegate * binlog_relay_io_delegate
Definition: rpl_handler.cc:77
Server_state_delegate * server_state_delegate
Definition: rpl_handler.cc:74
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:440
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:80
int launch_hook_trans_begin(THD *thd, Table_ref *table)
Definition: rpl_handler.cc:1379
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:79
void delegates_shutdown()
Verify that the replication plugins are ready and OK to be unloaded.
Definition: rpl_handler.cc:393
void delegates_destroy()
Definition: rpl_handler.cc:402
void delegates_acquire_locks()
Invokes write_lock() for all the observer delegate objects.
Definition: rpl_handler.cc:424
PSI_rwlock_key key_rwlock_Binlog_transmit_delegate_lock
Definition: mysqld.cc:13889
Observes and extends the service of slave IO thread.
Definition: replication.h:738
Replication binlog relay IO observer parameter.
Definition: replication.h:602
Observe binlog logging storage.
Definition: replication.h:450
Observe and extends the binlog dumping thread.
Definition: replication.h:580
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:409
Observes and extends transaction execution.
Definition: replication.h:305
An instrumented rwlock structure.
Definition: mysql_rwlock_bits.h:51
Definition: sql_plugin_ref.h:45