![]() |
MySQL 8.0.43
Source Code Documentation
|
#include <sys/types.h>#include <atomic>#include <map>#include "my_alloc.h"#include "my_dbug.h"#include "my_inttypes.h"#include "my_psi_config.h"#include "my_sys.h"#include "mysql/components/services/bits/mysql_rwlock_bits.h"#include "mysql/components/services/bits/psi_rwlock_bits.h"#include "mysql/psi/mysql_rwlock.h"#include "sql/locks/shared_spin_lock.h"#include "sql/psi_memory_key.h"#include "sql/sql_list.h"#include "sql/sql_plugin.h"#include "sql/sql_plugin_ref.h"Go to the source code of this file.
Classes | |
| class | Observer_info |
| class | Delegate |
| Base class for adding replication event observer infra-structure. More... | |
| class | Trans_delegate |
| class | Server_state_delegate |
| class | Binlog_storage_delegate |
| class | Binlog_transmit_delegate |
| class | Binlog_relay_IO_delegate |
Macros | |
| #define | RUN_HOOK(group, hook, args) (group##_delegate->is_empty() ? 0 : group##_delegate->hook args) |
| #define | NO_HOOK(group) (group##_delegate->is_empty()) |
Functions | |
| int | delegates_init () |
| void | delegates_shutdown () |
| Verify that the replication plugins are ready and OK to be unloaded. More... | |
| void | delegates_destroy () |
| void | delegates_acquire_locks () |
Invokes write_lock() for all the observer delegate objects. More... | |
| void | delegates_release_locks () |
| Releases locks for all the observer delegate objects. More... | |
| void | delegates_update_lock_type () |
| Toggles the type of lock between a classical read-write lock and a shared-exclusive spin-lock. More... | |
| int | launch_hook_trans_begin (THD *thd, Table_ref *table) |
Variables | |
| bool | opt_replication_optimize_for_static_plugin_config |
Variable to keep the value set for the replication_optimize_for_static_plugin_config global. More... | |
| std::atomic< bool > | opt_replication_sender_observe_commit_only |
Variable to keep the value set for the replication_sender_observe_commit_only global. More... | |
| PSI_rwlock_key | key_rwlock_Trans_delegate_lock |
| PSI_rwlock_key | key_rwlock_Server_state_delegate_lock |
| PSI_rwlock_key | key_rwlock_Binlog_storage_delegate_lock |
| PSI_rwlock_key | key_rwlock_Binlog_transmit_delegate_lock |
| PSI_rwlock_key | key_rwlock_Binlog_relay_IO_delegate_lock |
| Trans_delegate * | transaction_delegate |
| Binlog_storage_delegate * | binlog_storage_delegate |
| Server_state_delegate * | server_state_delegate |
| Binlog_transmit_delegate * | binlog_transmit_delegate |
| Binlog_relay_IO_delegate * | binlog_relay_io_delegate |
| #define NO_HOOK | ( | group | ) | (group##_delegate->is_empty()) |
| #define RUN_HOOK | ( | group, | |
| hook, | |||
| args | |||
| ) | (group##_delegate->is_empty() ? 0 : group##_delegate->hook args) |
| void delegates_acquire_locks | ( | ) |
Invokes write_lock() for all the observer delegate objects.
| void delegates_destroy | ( | ) |
| int delegates_init | ( | ) |
| void delegates_release_locks | ( | ) |
Releases locks for all the observer delegate objects.
| void delegates_shutdown | ( | ) |
Verify that the replication plugins are ready and OK to be unloaded.
| void delegates_update_lock_type | ( | ) |
Toggles the type of lock between a classical read-write lock and a shared-exclusive spin-lock.
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
Variable to keep the value set for the replication_optimize_for_static_plugin_config global.
When this global variable value is set to 1, we prevent all plugins that register replication observers to be unloaded until the variable is set to 0, again. While the value of the variable is 1, we are also exchanging the Delegate class read-write lock by an atomic-based shared spin-lock.
This behaviour is useful for increasing the throughtput of the master when a large number of slaves is connected, by preventing the acquisition of the LOCK_plugin mutex and using a more read-friendly lock in the Delegate class, when invoking the observer's hooks.
Note that a large number of slaves means a large number of dump threads, which means a large number of threads calling the registered observers hooks.
If UNINSTALL is executed on a replication observer plugin while the variable is set to 1, the unload of the plugin will be deferred until the variable's value is set to 0.
|
extern |
Variable to keep the value set for the replication_sender_observe_commit_only global.
When this global variable is set to 1, only the replication observer's commit hook will be called, every other registered hook invocation is skipped.
|
extern |
|
extern |