MySQL 8.3.0
Source Code Documentation
rpl_msr.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 2023, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef RPL_MSR_H
24#define RPL_MSR_H
25
26#include "my_config.h"
27
28#include <stddef.h>
29#include <sys/types.h>
30#include <map>
31#include <string>
32#include <utility>
33#include <vector>
34
35#include "my_dbug.h"
36#include "my_psi_config.h"
37#include "sql/mysqld.h" // key_rwlock_channel_map_lock
38#include "sql/rpl_channel_service_interface.h" // enum_channel_type
39#include "sql/rpl_filter.h"
40#include "sql/rpl_gtid.h"
41#include "sql/rpl_io_monitor.h"
42#include "sql/rpl_mi.h"
43
44class Master_info;
45
46/**
47 Maps a channel name to it's Master_info.
48*/
49
50// Maps a master info object to a channel name
51typedef std::map<std::string, Master_info *> mi_map;
52// Maps a channel type to a map of channels of that type.
53typedef std::map<int, mi_map> replication_channel_map;
54// Maps a replication filter to a channel name.
55typedef std::map<std::string, Rpl_filter *> filter_map;
56
57/**
58 Class to store all the Master_info objects of a slave
59 to access them in the replication code base or performance
60 schema replication tables.
61
62 In a Multisourced replication setup, a slave connects
63 to several masters (also called as sources). This class
64 stores the Master_infos where each Master_info belongs
65 to a slave.
66
67 The important objects for a slave are the following:
68 i) Master_info and Relay_log_info (replica_parallel_workers == 0)
69 ii) Master_info, Relay_log_info and Slave_worker(replica_parallel_workers >0 )
70
71 Master_info is always associated with a Relay_log_info per channel.
72 So, it is enough to store Master_infos and call the corresponding
73 Relay_log_info by mi->rli;
74
75 This class is not yet thread safe. Any part of replication code that
76 calls this class member function should always lock the channel_map.
77
78 Only a single global object for a server instance should be created.
79
80 The two important data structures in this class are
81 i) C++ std map to store the Master_info pointers with channel name as a key.
82 These are the base channel maps.
83 @todo Convert to boost after it's introduction.
84
85 ii) C++ std map to store the channel maps with a channel type as its key.
86 This map stores slave channel maps, group replication channels or others
87 iii) An array of Master_info pointers to access from performance schema
88 tables. This array is specifically implemented in a way to make
89 a) pfs indices simple i.e a simple integer counter
90 b) To avoid recalibration of data structure if master info is deleted.
91 * Consider the following high level implementation of a pfs table
92 to make a row.
93 @code
94 highlevel_pfs_funciton()
95 {
96 while(replication_table_xxxx.rnd_next())
97 {
98 do stuff;
99 }
100 }
101 @endcode
102 However, we lock channel_map lock for every rnd_next(); There is a gap
103 where an addition/deletion of a channel would rearrange the map
104 making the integer indices of the pfs table point to a wrong value.
105 Either missing a row or duplicating a row.
106
107 We solve this problem, by using an array exclusively to use in
108 replciation pfs tables, by marking a master_info defeated as 0
109 (i.e NULL). A new master info is added to this array at the
110 first NULL always.
111*/
113 private:
114 /* Maximum number of channels per slave */
115 static const unsigned int MAX_CHANNELS = 256;
116
117 /* A Map that maps, a channel name to a Master_info grouped by channel type */
119
120 /* Number of master_infos at the moment*/
122
123 /**
124 Default_channel for this instance, currently is predefined
125 and cannot be modified.
126 */
127 static const char *default_channel;
130
131 /**
132 This lock was designed to protect the channel_map from adding or removing
133 master_info objects from the map (adding or removing replication channels).
134 In fact it also acts like the LOCK_active_mi of MySQL 5.6, preventing two
135 replication administrative commands to run in parallel.
136 */
138
139#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
140
141 /* Array for replication performance schema related tables */
143
144#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
145
146 /*
147 A empty mi_map to allow Multisource_info::end() to return a
148 valid constant value.
149 */
151
152 public:
153 /* Constructor for this class.*/
155 /*
156 This class should be a singleton.
157 The assert below is to prevent it to be instantiated more than once.
158 */
159#ifndef NDEBUG
160 static int instance_count = 0;
161 instance_count++;
162 assert(instance_count == 1);
163#endif
165 default_channel_mi = nullptr;
166#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
168#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
169
173#endif
174 );
175 }
176
177 /* Destructor for this class.*/
179
180 /**
181 Adds the Master_info object to both replication_channel_map and rpl_pfs_mi
182
183 @param[in] channel_name channel name
184 @param[in] mi pointer to master info corresponding
185 to this channel
186 @retval false successfully added
187 @retval true couldn't add channel
188 */
189 bool add_mi(const char *channel_name, Master_info *mi);
190
191 /**
192 Find the master_info object corresponding to a channel explicitly
193 from replication channel_map;
194 Return if it exists, otherwise return 0
195
196 @param[in] channel_name channel name for the master info object.
197
198 @returns pointer to the master info object if exists
199 in the map. Otherwise, NULL;
200 */
201 Master_info *get_mi(const char *channel_name);
202
203 /**
204 Return the master_info object corresponding to the default channel.
205 @retval pointer to the master info object if exists.
206 Otherwise, NULL;
207 */
210 return default_channel_mi;
211 }
212
213 /**
214 Remove the entry corresponding to the channel, from the
215 replication_channel_map and sets index in the multisource_mi to 0;
216 And also delete the {mi, rli} pair corresponding to this channel
217
218 @note this requires the caller to hold the mi->channel_wrlock.
219 If the method succeeds the master info object is deleted and the lock
220 is released. If the an error occurs and the method return true, the {mi}
221 object won't be deleted and the caller should release the channel_wrlock.
222
223 @param[in] channel_name Name of the channel for a Master_info
224 object which must exist.
225
226 @return true if an error occurred, false otherwise
227 */
228 bool delete_mi(const char *channel_name);
229
230 /**
231 Get the default channel for this multisourced_slave;
232 */
233 inline const char *get_default_channel() { return default_channel; }
234
235 /**
236 Get the number of instances of Master_info in the map.
237
238 @param all If it should count all channels.
239 If false, only slave channels are counted.
240
241 @return The number of channels or 0 if empty.
242 */
243 inline size_t get_num_instances(bool all = false) {
245
247
248 replication_channel_map::iterator map_it;
249
250 if (all) {
251 size_t count = 0;
252
253 for (map_it = rep_channel_map.begin(); map_it != rep_channel_map.end();
254 map_it++) {
255 count += map_it->second.size();
256 }
257 return count;
258 } else // Return only the slave channels
259 {
261
262 if (map_it == rep_channel_map.end())
263 return 0;
264 else
265 return map_it->second.size();
266 }
267 }
268
269 /**
270 Get the number of running channels which have asynchronous replication
271 failover feature, i.e. CHANGE MASTER TO option
272 SOURCE_CONNECTION_AUTO_FAILOVER, enabled.
273
274 @return The number of channels.
275 */
279 size_t count = 0;
280
281 replication_channel_map::iterator map_it =
283
284 for (mi_map::iterator it = map_it->second.begin();
285 it != map_it->second.end(); it++) {
286 Master_info *mi = it->second;
290 if (mi->slave_running || mi->is_error()) {
291 count++;
292 }
294 }
295 }
296
297#ifndef NDEBUG
298 if (Source_IO_monitor::get_instance()->is_monitoring_process_running()) {
299 assert(count > 0);
300 }
301#endif
302
303 return count;
304 }
305
306 /**
307 Get max channels allowed for this map.
308 */
309 inline uint get_max_channels() { return MAX_CHANNELS; }
310
311 /**
312 Returns true if the current number of channels in this slave
313 is less than the MAX_CHANNLES
314 */
318 DBUG_EXECUTE_IF("max_replication_channels_exceeded", is_valid = false;);
319 return (is_valid);
320 }
321
322 /**
323 Returns if a channel name is one of the reserved group replication names
324
325 @param channel the channel name to test
326 @param is_applier compare only with applier name
327
328 @retval true the name is a reserved name
329 @retval false non reserved name
330 */
332 bool is_applier = false);
333
334 /**
335 Forward iterators to initiate traversing of a map.
336
337 @todo: Not to expose iterators. But instead to return
338 only Master_infos or create generators when
339 c++11 is introduced.
340 */
341 mi_map::iterator begin(
343 replication_channel_map::iterator map_it;
344 map_it = rep_channel_map.find(channel_type);
345
346 if (map_it != rep_channel_map.end()) {
347 return map_it->second.begin();
348 }
349
350 return end(channel_type);
351 }
352
353 mi_map::iterator end(
355 replication_channel_map::iterator map_it;
356 map_it = rep_channel_map.find(channel_type);
357
358 if (map_it != rep_channel_map.end()) {
359 return map_it->second.end();
360 }
361
362 return empty_mi_map.end();
363 }
364
365 private:
366#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
367
368 /* Initialize the rpl_pfs_mi array to NULLs */
369 inline void init_rpl_pfs_mi() {
370 for (uint i = 0; i < MAX_CHANNELS; i++) rpl_pfs_mi[i] = nullptr;
371 }
372
373 /**
374 Add a master info pointer to the rpl_pfs_mi array at the first
375 NULL;
376
377 @param[in] mi master info object to be added.
378
379 @return false if success.Else true.
380 */
382
383 /**
384 Get the index of the master info corresponding to channel name
385 from the rpl_pfs_mi array.
386 @param[in] channel_name Channel name to get the index from
387
388 @return index of mi for the channel_name. Else -1;
389 */
390 int get_index_from_rpl_pfs_mi(const char *channel_name);
391
392 public:
393 /**
394 Used only by replication performance schema indices to get the master_info
395 at the position 'pos' from the rpl_pfs_mi array.
396
397 @param[in] pos the index in the rpl_pfs_mi array
398
399 @retval pointer to the master info object at pos 'pos';
400 */
401 Master_info *get_mi_at_pos(uint pos);
402#endif /*WITH_PERFSCHEMA_STORAGE_ENGINE */
403
404 /**
405 Acquire the read lock.
406 */
407 inline void rdlock() { m_channel_map_lock->rdlock(); }
408
409 /**
410 Try to acquire a read lock, return 0 if the read lock is held,
411 otherwise an error will be returned.
412
413 @return 0 in case of success, or 1 otherwise.
414 */
415 inline int tryrdlock() { return m_channel_map_lock->tryrdlock(); }
416
417 /**
418 Acquire the write lock.
419 */
420 inline void wrlock() { m_channel_map_lock->wrlock(); }
421
422 /**
423 Try to acquire a write lock, return 0 if the write lock is held,
424 otherwise an error will be returned.
425
426 @return 0 in case of success, or 1 otherwise.
427 */
428 inline int trywrlock() { return m_channel_map_lock->trywrlock(); }
429
430 /**
431 Release the lock (whether it is a write or read lock).
432 */
433 inline void unlock() { m_channel_map_lock->unlock(); }
434
435 /**
436 Assert that some thread holds either the read or the write lock.
437 */
438 inline void assert_some_lock() const {
440 }
441
442 /**
443 Assert that some thread holds the write lock.
444 */
445 inline void assert_some_wrlock() const {
447 }
448};
449
450/**
451 The class is a container for all the per-channel filters, both a map of
452 Rpl_filter objects and a list of Rpl_pfs_filter objects.
453 It maintains a filter map which maps a replication filter to a channel
454 name. Which is needed, because replication channels are not created and
455 channel_map is not filled in when these global and per-channel replication
456 filters are evaluated with current code frame.
457 In theory, after instantiating all channels from the repository and throwing
458 all the warnings about the filters configured for non-existent channels, we
459 can forget about its global object rpl_channel_filters and rely only on the
460 global and per channel Rpl_filter objects. But to avoid holding the
461 channel_map.rdlock() when querying P_S.replication_applier_filters table,
462 we keep the rpl_channel_filters. So that we just need to hold the small
463 rpl_channel_filters.rdlock() when querying P_S.replication_applier_filters
464 table. Many operations (RESET SLAVE [FOR CHANNEL], START SLAVE, INIT SLAVE,
465 END SLAVE, CHANGE MASTER TO, FLUSH RELAY LOGS, START CHANNEL, PURGE CHANNEL,
466 and so on) hold the channel_map.wrlock().
467
468 There is one instance, rpl_channel_filters, created globally for Multisource
469 channel filters. The rpl_channel_filters is created when the server is
470 started, destroyed when the server is stopped.
471*/
473 private:
474 /* Store all replication filters with channel names. */
476 /* Store all Rpl_pfs_filter objects in the channel_to_filter. */
477 std::vector<Rpl_pfs_filter> rpl_pfs_filter_vec;
478 /*
479 This lock was designed to protect the channel_to_filter from reading,
480 adding, or removing its objects from the map. It is used to preventing
481 the following commands to run in parallel:
482 RESET SLAVE ALL [FOR CHANNEL '<channel_name>']
483 CHANGE MASTER TO ... FOR CHANNEL
484 SELECT FROM performance_schema.replication_applier_filters
485
486 Please acquire a wrlock when modifying the map structure (RESET SLAVE ALL
487 [FOR CHANNEL '<channel_name>'], CHANGE MASTER TO ... FOR CHANNEL).
488 Please acqurie a rdlock when querying existing filter(s) (SELECT FROM
489 performance_schema.replication_applier_filters).
490
491 Note: To modify the object from the map, please see the protection of
492 m_rpl_filter_lock in Rpl_filter.
493 */
495
496 public:
497 /**
498 Create a new replication filter and add it into a filter map.
499
500 @param channel_name A name of a channel.
501
502 @retval Rpl_filter A pointer to a replication filter, or NULL
503 if we failed to add it into fiter_map.
504 */
505 Rpl_filter *create_filter(const char *channel_name);
506 /**
507 Delete the replication filter from the filter map.
508
509 @param rpl_filter A pointer to point to a replication filter.
510 */
512 /**
513 Discard all replication filters if they are not attached to channels.
514 */
516 /**
517 discard filters on group replication channels.
518 */
520 /**
521 Get a replication filter of a channel.
522
523 @param channel_name A name of a channel.
524
525 @retval Rpl_filter A pointer to a replication filter, or NULL
526 if we failed to add a replication filter
527 into fiter_map when creating it.
528 */
529 Rpl_filter *get_channel_filter(const char *channel_name);
530
531#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
532
533 /**
534 This member function is called every time a filter is created or deleted,
535 or its filter rules are changed. Once that happens the PFS view is
536 recreated.
537 */
538 void reset_pfs_view();
539
540 /**
541 Used only by replication performance schema indices to get the replication
542 filter at the position 'pos' from the rpl_pfs_filter_vec vector.
543
544 @param pos the index in the rpl_pfs_filter_vec vector.
545
546 @retval Rpl_filter A pointer to a Rpl_pfs_filter, or NULL if it
547 arrived the end of the rpl_pfs_filter_vec.
548 */
550 /**
551 Used only by replication performance schema indices to get the count
552 of replication filters from the rpl_pfs_filter_vec vector.
553
554 @retval the count of the replication filters.
555 */
556 uint get_filter_count();
557#endif /*WITH_PERFSCHEMA_STORAGE_ENGINE */
558
559 /**
560 Traverse the filter map, build do_table and ignore_table
561 rules to hashes for every filter.
562
563 @retval
564 0 OK
565 @retval
566 -1 Error
567 */
569
570 /* Constructor for this class.*/
575#endif
576 );
577 }
578
579 /* Destructor for this class. */
581
582 /**
583 Traverse the filter map and free all filters. Delete all objects
584 in the rpl_pfs_filter_vec vector and then clear the vector.
585 */
586 void clean_up() {
587 /* Traverse the filter map and free all filters */
588 for (filter_map::iterator it = channel_to_filter.begin();
589 it != channel_to_filter.end(); it++) {
590 if (it->second != nullptr) {
591 delete it->second;
592 it->second = nullptr;
593 }
594 }
595
596 rpl_pfs_filter_vec.clear();
597 }
598
599 /**
600 Acquire the write lock.
601 */
603
604 /**
605 Acquire the read lock.
606 */
608
609 /**
610 Release the lock (whether it is a write or read lock).
611 */
613};
614
615/* Global object for multisourced slave. */
617
618/* Global object for storing per-channel replication filters */
620
621static bool inline is_slave_configured() {
622 /* Server was started with server_id == 0
623 OR
624 failure to load applier metadata repositories
625 */
626 return (channel_map.get_default_channel_mi() != nullptr);
627}
628
629#endif /*RPL_MSR_H*/
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:323
int trywrlock()
Return 0 if the write lock is held, otherwise an error will be returned.
Definition: rpl_gtid.h:536
void rdlock()
Acquire the read lock.
Definition: rpl_gtid.h:484
void wrlock()
Acquire the write lock.
Definition: rpl_gtid.h:493
int tryrdlock()
Return 0 if the read lock is held, otherwise an error will be returned.
Definition: rpl_gtid.h:555
void assert_some_lock() const
Assert that some thread holds either the read or the write lock.
Definition: rpl_gtid.h:570
void unlock()
Release the lock (whether it is a write or read lock).
Definition: rpl_gtid.h:504
void assert_some_wrlock() const
Assert that some thread holds the write lock.
Definition: rpl_gtid.h:574
Definition: rpl_mi.h:86
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:56
bool is_error() const
Definition: rpl_reporting.h:143
static Source_IO_monitor * get_instance()
Fetch Source_IO_monitor class instance.
Definition: rpl_io_monitor.cc:1089
#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:44
PSI_rwlock_key key_rwlock_channel_to_filter_lock
Definition: mysqld.cc:13706
PSI_rwlock_key key_rwlock_channel_map_lock
Definition: mysqld.cc:13702
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
Rpl_filter * rpl_filter
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
Definition: task.h:426