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