52typedef std::map<std::string, Master_info *>
mi_map;
140#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
161 static int instance_count = 0;
163 assert(instance_count == 1);
167#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
229 bool delete_mi(
const char *channel_name);
249 replication_channel_map::iterator map_it;
256 count += map_it->second.size();
266 return map_it->second.size();
282 replication_channel_map::iterator map_it =
285 for (mi_map::iterator it = map_it->second.begin();
286 it != map_it->second.end(); it++) {
347 return mi && (mi->
host[0] ||
360 replication_channel_map::iterator map_it;
364 return map_it->second.begin();
367 return end(channel_type);
372 replication_channel_map::iterator map_it;
376 return map_it->second.end();
383#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
548#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
607 if (it->second !=
nullptr) {
609 it->second =
nullptr;
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:324
int trywrlock()
Return 0 if the write lock is held, otherwise an error will be returned.
Definition: rpl_gtid.h:537
void rdlock()
Acquire the read lock.
Definition: rpl_gtid.h:485
void wrlock()
Acquire the write lock.
Definition: rpl_gtid.h:494
int tryrdlock()
Return 0 if the read lock is held, otherwise an error will be returned.
Definition: rpl_gtid.h:556
void assert_some_lock() const
Assert that some thread holds either the read or the write lock.
Definition: rpl_gtid.h:571
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_gtid.h:505
void assert_some_wrlock() const
Assert that some thread holds the write lock.
Definition: rpl_gtid.h:575
bool is_source_connection_auto_failover()
Checks if Asynchronous Replication Connection Failover feature is enabled.
Definition: rpl_mi.h:519
static bool is_configured(Master_info *mi)
Definition: rpl_mi.h:109
char host[HOSTNAME_LENGTH+1]
Host name or ip address stored in the master.info.
Definition: rpl_mi.h:99
Class to store all the Master_info objects of a slave to access them in the replication code base or ...
Definition: rpl_msr.h:113
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:231
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:200
Multisource_info()
Definition: rpl_msr.h:155
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:277
mi_map::iterator end(enum_channel_type channel_type=SLAVE_REPLICATION_CHANNEL)
Definition: rpl_msr.h:370
void assert_some_lock() const
Assert that some thread holds either the read or the write lock.
Definition: rpl_msr.h:455
static const char * group_replication_channel_names[]
Definition: rpl_msr.h:130
void wrlock()
Acquire the write lock.
Definition: rpl_msr.h:437
static const char * default_channel
Default_channel for this instance, currently is predefined and cannot be modified.
Definition: rpl_msr.h:128
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:445
Master_info * get_default_channel_mi()
Return the master_info object corresponding to the default channel.
Definition: rpl_msr.h:209
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:218
uint get_max_channels()
Get max channels allowed for this map.
Definition: rpl_msr.h:310
void init_rpl_pfs_mi()
Definition: rpl_msr.h:386
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:138
Master_info * default_channel_mi
Definition: rpl_msr.h:129
uint current_mi_count
Definition: rpl_msr.h:122
bool is_group_replication_applier_channel_name(const char *channel)
Checks if a channel is the group replication applier channel.
Definition: rpl_msr.cc:183
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:117
bool is_group_replication_recovery_channel_name(const char *channel)
Checks if a channel is the group replication recovery channel.
Definition: rpl_msr.cc:188
~Multisource_info()
Definition: rpl_msr.h:179
void rdlock()
Acquire the read lock.
Definition: rpl_msr.h:424
bool is_group_replication_channel_name(const char *channel)
Returns if a channel name is one of the reserved group replication names.
Definition: rpl_msr.cc:193
void assert_some_wrlock() const
Assert that some thread holds the write lock.
Definition: rpl_msr.h:462
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:41
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_msr.h:450
mi_map::iterator begin(enum_channel_type channel_type=SLAVE_REPLICATION_CHANNEL)
Forward iterators to initiate traversing of a map.
Definition: rpl_msr.h:358
bool is_channel_configured(Master_info *mi)
Check if the channel has an hostname or is a GR channel.
Definition: rpl_msr.h:346
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:86
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:316
const char * get_default_channel()
Get the default channel for this multisourced_slave;.
Definition: rpl_msr.h:234
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:432
Master_info * rpl_pfs_mi[MAX_CHANNELS]
Definition: rpl_msr.h:143
replication_channel_map rep_channel_map
Definition: rpl_msr.h:119
mi_map empty_mi_map
Definition: rpl_msr.h:151
static const unsigned int MAX_CHANNELS
Definition: rpl_msr.h:116
size_t get_num_instances(bool all=false)
Get the number of instances of Master_info in the map.
Definition: rpl_msr.h:244
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:489
Checkable_rwlock * m_channel_to_filter_lock
Definition: rpl_msr.h:511
uint get_filter_count()
Used only by replication performance schema indices to get the count of replication filters from the ...
Definition: rpl_msr.cc:388
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:378
Rpl_filter * get_channel_filter(const char *channel_name)
Get a replication filter of a channel.
Definition: rpl_msr.cc:340
std::vector< Rpl_pfs_filter > rpl_pfs_filter_vec
Definition: rpl_msr.h:494
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:363
void clean_up()
Traverse the filter map and free all filters.
Definition: rpl_msr.h:603
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_msr.h:629
void delete_filter(Rpl_filter *rpl_filter)
Delete the replication filter from the filter map.
Definition: rpl_msr.cc:270
void discard_group_replication_filters()
discard filters on group replication channels.
Definition: rpl_msr.cc:291
void discard_all_unattached_filters()
Discard all replication filters if they are not attached to channels.
Definition: rpl_msr.cc:309
Rpl_channel_filters()
Definition: rpl_msr.h:588
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:397
filter_map channel_to_filter
Definition: rpl_msr.h:492
Rpl_filter * create_filter(const char *channel_name)
Create a new replication filter and add it into a filter map.
Definition: rpl_msr.cc:241
~Rpl_channel_filters()
Definition: rpl_msr.h:597
void wrlock()
Acquire the write lock.
Definition: rpl_msr.h:619
void rdlock()
Acquire the read lock.
Definition: rpl_msr.h:624
Rpl_filter.
Definition: rpl_filter.h:214
char * get_channel() const
Definition: rpl_info.h:125
std::atomic< uint > slave_running
Definition: rpl_info.h:82
The class Rpl_pfs_filter is introduced to serve the performance_schema.replication_applier_filters ta...
Definition: rpl_filter.h:167
mysql_mutex_t err_lock
lock used to synchronize m_last_error on 'SHOW REPLICA STATUS'
Definition: rpl_reporting.h:57
bool is_error() const
Definition: rpl_reporting.h:144
static Source_IO_monitor * get_instance()
Fetch Source_IO_monitor class instance.
Definition: rpl_io_monitor.cc:1090
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:50
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:57
#define DBUG_EXECUTE_IF(keyword, a1)
Definition: my_dbug.h:171
#define DBUG_TRACE
Definition: my_dbug.h:146
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
#define HAVE_PSI_INTERFACE
Definition: my_psi_config.h:39
static int count
Definition: myisam_ftdump.cc:45
PSI_rwlock_key key_rwlock_channel_to_filter_lock
Definition: mysqld.cc:13466
PSI_rwlock_key key_rwlock_channel_map_lock
Definition: mysqld.cc:13462
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:95
enum_channel_type
Types of channels.
Definition: rpl_channel_service_interface.h:51
@ SLAVE_REPLICATION_CHANNEL
Definition: rpl_channel_service_interface.h:52
std::map< std::string, Master_info * > mi_map
Maps a channel name to it's Master_info.
Definition: rpl_msr.h:45
static bool is_slave_configured()
Definition: rpl_msr.h:638
std::map< std::string, Rpl_filter * > filter_map
Definition: rpl_msr.h:56
Multisource_info channel_map
Definition: rpl_msr.cc:418
std::map< int, mi_map > replication_channel_map
Definition: rpl_msr.h:54
Rpl_channel_filters rpl_channel_filters
Definition: rpl_msr.cc:420