51typedef std::map<std::string, Master_info *>
mi_map;
139#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
160 static int instance_count = 0;
162 assert(instance_count == 1);
166#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
228 bool delete_mi(
const char *channel_name);
248 replication_channel_map::iterator map_it;
255 count += map_it->second.size();
265 return map_it->second.size();
281 replication_channel_map::iterator map_it =
284 for (mi_map::iterator it = map_it->second.begin();
285 it != map_it->second.end(); it++) {
332 bool is_applier =
false);
343 replication_channel_map::iterator map_it;
347 return map_it->second.begin();
350 return end(channel_type);
355 replication_channel_map::iterator map_it;
359 return map_it->second.end();
366#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
531#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
590 if (it->second !=
nullptr) {
592 it->second =
nullptr;
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:308
int trywrlock()
Return 0 if the write lock is held, otherwise an error will be returned.
Definition: rpl_gtid.h:511
void rdlock()
Acquire the read lock.
Definition: rpl_gtid.h:459
void wrlock()
Acquire the write lock.
Definition: rpl_gtid.h:468
int tryrdlock()
Return 0 if the read lock is held, otherwise an error will be returned.
Definition: rpl_gtid.h:530
void assert_some_lock() const
Assert that some thread holds either the read or the write lock.
Definition: rpl_gtid.h:545
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_gtid.h:479
void assert_some_wrlock() const
Assert that some thread holds the write lock.
Definition: rpl_gtid.h:549
bool is_source_connection_auto_failover()
Checks if Asynchronous Replication Connection Failover feature is enabled.
Definition: rpl_mi.h:512
static bool is_configured(Master_info *mi)
Definition: rpl_mi.h:103
Class to store all the Master_info objects of a slave to access them in the replication code base or ...
Definition: rpl_msr.h:112
Master_info * get_mi_at_pos(uint pos)
Used only by replication performance schema indices to get the master_info at the position 'pos' from...
Definition: rpl_msr.cc:224
bool is_group_replication_channel_name(const char *channel, bool is_applier=false)
Returns if a channel name is one of the reserved group replication names.
Definition: rpl_msr.cc:182
bool add_mi_to_rpl_pfs_mi(Master_info *mi)
Add a master info pointer to the rpl_pfs_mi array at the first NULL;.
Definition: rpl_msr.cc:193
Multisource_info()
Definition: rpl_msr.h:154
size_t get_number_of_connection_auto_failover_channels_running()
Get the number of running channels which have asynchronous replication failover feature,...
Definition: rpl_msr.h:276
mi_map::iterator end(enum_channel_type channel_type=SLAVE_REPLICATION_CHANNEL)
Definition: rpl_msr.h:353
void assert_some_lock() const
Assert that some thread holds either the read or the write lock.
Definition: rpl_msr.h:438
static const char * group_replication_channel_names[]
Definition: rpl_msr.h:129
void wrlock()
Acquire the write lock.
Definition: rpl_msr.h:420
static const char * default_channel
Default_channel for this instance, currently is predefined and cannot be modified.
Definition: rpl_msr.h:127
int trywrlock()
Try to acquire a write lock, return 0 if the write lock is held, otherwise an error will be returned.
Definition: rpl_msr.h:428
Master_info * get_default_channel_mi()
Return the master_info object corresponding to the default channel.
Definition: rpl_msr.h:208
int get_index_from_rpl_pfs_mi(const char *channel_name)
Get the index of the master info corresponding to channel name from the rpl_pfs_mi array.
Definition: rpl_msr.cc:211
uint get_max_channels()
Get max channels allowed for this map.
Definition: rpl_msr.h:309
void init_rpl_pfs_mi()
Definition: rpl_msr.h:369
Checkable_rwlock * m_channel_map_lock
This lock was designed to protect the channel_map from adding or removing master_info objects from th...
Definition: rpl_msr.h:137
Master_info * default_channel_mi
Definition: rpl_msr.h:128
uint current_mi_count
Definition: rpl_msr.h:121
bool delete_mi(const char *channel_name)
Remove the entry corresponding to the channel, from the replication_channel_map and sets index in the...
Definition: rpl_msr.cc:116
~Multisource_info()
Definition: rpl_msr.h:178
void rdlock()
Acquire the read lock.
Definition: rpl_msr.h:407
void assert_some_wrlock() const
Assert that some thread holds the write lock.
Definition: rpl_msr.h:445
bool add_mi(const char *channel_name, Master_info *mi)
Adds the Master_info object to both replication_channel_map and rpl_pfs_mi.
Definition: rpl_msr.cc:40
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_msr.h:433
mi_map::iterator begin(enum_channel_type channel_type=SLAVE_REPLICATION_CHANNEL)
Forward iterators to initiate traversing of a map.
Definition: rpl_msr.h:341
Master_info * get_mi(const char *channel_name)
Find the master_info object corresponding to a channel explicitly from replication channel_map; Retur...
Definition: rpl_msr.cc:85
bool is_valid_channel_count()
Returns true if the current number of channels in this slave is less than the MAX_CHANNLES.
Definition: rpl_msr.h:315
const char * get_default_channel()
Get the default channel for this multisourced_slave;.
Definition: rpl_msr.h:233
int tryrdlock()
Try to acquire a read lock, return 0 if the read lock is held, otherwise an error will be returned.
Definition: rpl_msr.h:415
Master_info * rpl_pfs_mi[MAX_CHANNELS]
Definition: rpl_msr.h:142
replication_channel_map rep_channel_map
Definition: rpl_msr.h:118
mi_map empty_mi_map
Definition: rpl_msr.h:150
static const unsigned int MAX_CHANNELS
Definition: rpl_msr.h:115
size_t get_num_instances(bool all=false)
Get the number of instances of Master_info in the map.
Definition: rpl_msr.h:243
The class is a container for all the per-channel filters, both a map of Rpl_filter objects and a list...
Definition: rpl_msr.h:472
Checkable_rwlock * m_channel_to_filter_lock
Definition: rpl_msr.h:494
uint get_filter_count()
Used only by replication performance schema indices to get the count of replication filters from the ...
Definition: rpl_msr.cc:381
Rpl_pfs_filter * get_filter_at_pos(uint pos)
Used only by replication performance schema indices to get the replication filter at the position 'po...
Definition: rpl_msr.cc:371
Rpl_filter * get_channel_filter(const char *channel_name)
Get a replication filter of a channel.
Definition: rpl_msr.cc:333
std::vector< Rpl_pfs_filter > rpl_pfs_filter_vec
Definition: rpl_msr.h:477
void reset_pfs_view()
This member function is called every time a filter is created or deleted, or its filter rules are cha...
Definition: rpl_msr.cc:356
void clean_up()
Traverse the filter map and free all filters.
Definition: rpl_msr.h:586
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_msr.h:612
void delete_filter(Rpl_filter *rpl_filter)
Delete the replication filter from the filter map.
Definition: rpl_msr.cc:263
void discard_group_replication_filters()
discard filters on group replication channels.
Definition: rpl_msr.cc:284
void discard_all_unattached_filters()
Discard all replication filters if they are not attached to channels.
Definition: rpl_msr.cc:302
Rpl_channel_filters()
Definition: rpl_msr.h:571
bool build_do_and_ignore_table_hashes()
Traverse the filter map, build do_table and ignore_table rules to hashes for every filter.
Definition: rpl_msr.cc:390
filter_map channel_to_filter
Definition: rpl_msr.h:475
Rpl_filter * create_filter(const char *channel_name)
Create a new replication filter and add it into a filter map.
Definition: rpl_msr.cc:234
~Rpl_channel_filters()
Definition: rpl_msr.h:580
void wrlock()
Acquire the write lock.
Definition: rpl_msr.h:602
void rdlock()
Acquire the read lock.
Definition: rpl_msr.h:607
Rpl_filter.
Definition: rpl_filter.h:213
std::atomic< uint > slave_running
Definition: rpl_info.h:81
The class Rpl_pfs_filter is introduced to serve the performance_schema.replication_applier_filters ta...
Definition: rpl_filter.h:166
mysql_mutex_t err_lock
lock used to synchronize m_last_error on 'SHOW SLAVE STATUS'
Definition: rpl_reporting.h:55
bool is_error() const
Definition: rpl_reporting.h:137
static Source_IO_monitor * get_instance()
Fetch Source_IO_monitor class instance.
Definition: rpl_io_monitor.cc:1086
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:49
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:56
#define DBUG_EXECUTE_IF(keyword, a1)
Definition: my_dbug.h:170
#define DBUG_TRACE
Definition: my_dbug.h:145
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
#define HAVE_PSI_INTERFACE
Definition: my_psi_config.h:38
static int count
Definition: myisam_ftdump.cc:42
PSI_rwlock_key key_rwlock_channel_to_filter_lock
Definition: mysqld.cc:11845
PSI_rwlock_key key_rwlock_channel_map_lock
Definition: mysqld.cc:11841
bool is_valid(const dd::Spatial_reference_system *srs, const Geometry *g, const char *func_name, bool *is_valid) noexcept
Decides if a geometry is valid.
Definition: is_valid.cc:94
enum_channel_type
Types of channels.
Definition: rpl_channel_service_interface.h:50
@ SLAVE_REPLICATION_CHANNEL
Definition: rpl_channel_service_interface.h:51
std::map< std::string, Master_info * > mi_map
Maps a channel name to it's Master_info.
Definition: rpl_msr.h:44
static bool is_slave_configured()
Definition: rpl_msr.h:621
std::map< std::string, Rpl_filter * > filter_map
Definition: rpl_msr.h:55
Multisource_info channel_map
Definition: rpl_msr.cc:411
std::map< int, mi_map > replication_channel_map
Definition: rpl_msr.h:53
Rpl_channel_filters rpl_channel_filters
Definition: rpl_msr.cc:413
unsigned int uint
Definition: uca9-dump.cc:74
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:868