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++) {
333 bool is_applier =
false);
344 replication_channel_map::iterator map_it;
348 return map_it->second.begin();
351 return end(channel_type);
356 replication_channel_map::iterator map_it;
360 return map_it->second.end();
367#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
532#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
591 if (it->second !=
nullptr) {
593 it->second =
nullptr;
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:309
int trywrlock()
Return 0 if the write lock is held, otherwise an error will be returned.
Definition: rpl_gtid.h:512
void rdlock()
Acquire the read lock.
Definition: rpl_gtid.h:460
void wrlock()
Acquire the write lock.
Definition: rpl_gtid.h:469
int tryrdlock()
Return 0 if the read lock is held, otherwise an error will be returned.
Definition: rpl_gtid.h:531
void assert_some_lock() const
Assert that some thread holds either the read or the write lock.
Definition: rpl_gtid.h:546
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_gtid.h:480
void assert_some_wrlock() const
Assert that some thread holds the write lock.
Definition: rpl_gtid.h:550
bool is_source_connection_auto_failover()
Checks if Asynchronous Replication Connection Failover feature is enabled.
Definition: rpl_mi.h:513
static bool is_configured(Master_info *mi)
Definition: rpl_mi.h:104
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:225
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:183
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:194
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:354
void assert_some_lock() const
Assert that some thread holds either the read or the write lock.
Definition: rpl_msr.h:439
static const char * group_replication_channel_names[]
Definition: rpl_msr.h:130
void wrlock()
Acquire the write lock.
Definition: rpl_msr.h:421
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:429
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:212
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:370
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 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
~Multisource_info()
Definition: rpl_msr.h:179
void rdlock()
Acquire the read lock.
Definition: rpl_msr.h:408
void assert_some_wrlock() const
Assert that some thread holds the write lock.
Definition: rpl_msr.h:446
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:434
mi_map::iterator begin(enum_channel_type channel_type=SLAVE_REPLICATION_CHANNEL)
Forward iterators to initiate traversing of a map.
Definition: rpl_msr.h:342
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:416
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:473
Checkable_rwlock * m_channel_to_filter_lock
Definition: rpl_msr.h:495
uint get_filter_count()
Used only by replication performance schema indices to get the count of replication filters from the ...
Definition: rpl_msr.cc:382
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:372
Rpl_filter * get_channel_filter(const char *channel_name)
Get a replication filter of a channel.
Definition: rpl_msr.cc:334
std::vector< Rpl_pfs_filter > rpl_pfs_filter_vec
Definition: rpl_msr.h:478
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:357
void clean_up()
Traverse the filter map and free all filters.
Definition: rpl_msr.h:587
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_msr.h:613
void delete_filter(Rpl_filter *rpl_filter)
Delete the replication filter from the filter map.
Definition: rpl_msr.cc:264
void discard_group_replication_filters()
discard filters on group replication channels.
Definition: rpl_msr.cc:285
void discard_all_unattached_filters()
Discard all replication filters if they are not attached to channels.
Definition: rpl_msr.cc:303
Rpl_channel_filters()
Definition: rpl_msr.h:572
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:391
filter_map channel_to_filter
Definition: rpl_msr.h:476
Rpl_filter * create_filter(const char *channel_name)
Create a new replication filter and add it into a filter map.
Definition: rpl_msr.cc:235
~Rpl_channel_filters()
Definition: rpl_msr.h:581
void wrlock()
Acquire the write lock.
Definition: rpl_msr.h:603
void rdlock()
Acquire the read lock.
Definition: rpl_msr.h:608
Rpl_filter.
Definition: rpl_filter.h:214
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 SLAVE STATUS'
Definition: rpl_reporting.h:56
bool is_error() const
Definition: rpl_reporting.h:138
static Source_IO_monitor * get_instance()
Fetch Source_IO_monitor class instance.
Definition: rpl_io_monitor.cc:1087
#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:43
PSI_rwlock_key key_rwlock_channel_to_filter_lock
Definition: mysqld.cc:11950
PSI_rwlock_key key_rwlock_channel_map_lock
Definition: mysqld.cc:11946
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:622
std::map< std::string, Rpl_filter * > filter_map
Definition: rpl_msr.h:56
Multisource_info channel_map
Definition: rpl_msr.cc:412
std::map< int, mi_map > replication_channel_map
Definition: rpl_msr.h:54
Rpl_channel_filters rpl_channel_filters
Definition: rpl_msr.cc:414
unsigned int uint
Definition: uca9-dump.cc:75
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:872