Skip to content

Commit e3e1cd1

Browse files
author
Daogang Qu
committed
Wl#7361 MSR: per-channel replication filters
There are per-channel and global replication filters. Each channel uses *only* its own per-channel replication filters to filter the event stream. It never uses global replication filters to filter the event stream. (A new channel would copy global replication filters to its per-channel replication filters if there are no per-channel replication filters and there are global replication filters on the filter type when it is being configured.) The per-channel replication filters and global replication filters can be configured in two ways: A) startup options: --replicate-* B) SQL commands: CHANGE REPLICATION FILTER Additionally, behavior for the following statements needs to be specified: C) RESET SLAVE [ALL] [FOR CHANNEL] D) SHOW SLAVE STATUS [FOR CHANNEL] Query, troubleshoot, monitor replication filters and do statistics: E) CREATE A NEW performance_schema.replication_applier_filters Show the global replication filters: F) CREATE A NEW performance_schema.replication_applier_global_filters A) Startup options: --replicate-* ================================= The current startup options are extended by allowing to specify channel_name in filter variable to configure per-channel replication filters as follows. --replicate-do-db=<channel_name>:<database_id> --replicate-ignore-db=<channel_name>:<database_id> --replicate-do-table=<channel_name>:<table_id> --replicate-ignore-table=<channel_name>:<table_id> --replicate-rewrite-db=<channel_name>:<db1->db2> --replicate-wild-do-table=<channel_name>:<table regexid> --replicate-wild-ignore-table=<channel_name>:<table regexid> ---- Syntax ---- Each command line parameter optionally takes a channel_name followed by a colon, further followed by the filter specification. Note that the first colon is interpreted as a separator, others are literal colons. ---- Semantics ---- Without specifying channel_name in filter variable, the startup options shall act on the default channel. See below. --replicate-do-db=:<database_id> --replicate-ignore-db=:<database_id> --replicate-do-table=:<table_id> --replicate-ignore-table=:<table_id> --replicate-rewrite-db=:<from_db>-><to_db> --replicate-wild-do-table=:<table regex> --replicate-wild-ignore-table=:<table regex> Without specifying channel_name and a followed 'colon' in filter variable, the startup options shall configure the global replication filters. See below. --replicate-do-db=<database_id> --replicate-ignore-db=<database_id> --replicate-do-table=<table_id> --replicate-ignore-table=<table_id> --replicate-rewrite-db=<from_db>-><to_db> --replicate-wild-do-table=<table regex> --replicate-wild-ignore-table=<table regex> If the user specifies a per-channel replication filter through a command-line option (or in a configuration file) for a slave replication channel which does not exist as of now (i.e not present in slave info tables yet), then the per-channel replication filter is discarded with the following warning: "There are per-channel replication filter(s) configured for channel '%.192s' which does not exist. The filter(s) have been discarded." If the user specifies a per-channel replication filter through a command-line option (or in a configuration file) for group replication channels 'group_replication_recovery' and 'group_replication_applier' which is disallowed, then the per-channel replication filter is discarded with the following warning: "There are per-channel replication filter(s) configured for group replication channel '%.192s' which is disallowed. The filter(s) have been discarded." How global and per-channel replication filters work together? - Any global replication filter option will add the filter to global replication filters on the filter type, not add the filter to every channel on the filter type. - Any per-channel replication filter option will add the filter to per-channel replication filters of the specified channel on the filter type. - Every slave replication channel will copy global replication filters to its per-channel replication filters if there are no per-channel replication filters and there are global replication filters on the filter type when it is being configured. Example: Suppose channels '' and 'ch1' exist before the server starts, the command line options --replicate-do-db=db1 --replicate-do-db=ch1:db2 --replicate-do-db=db3 --replicate-ignore-db=db4 --replicate-ignore-db=:db5 would result in: global replication filters: do_db=db1,db3, ignore_db=db4 default channel: do_db=db1,db3 ignore_db=db5 ch1: do_db=db2 ignore_db=db4 Note: GROUP REPLICATION channels should not be configurable using --replicate* nor CHANGE REPLICATION FILTER, and should not inherit from global filters. BTW: if user specifies multiple replicate-rewrite-db=FROM->TO options having the same FROM database, all are added together (put into the rewrite_do list) and the first one takes affect. The global replication filters and per-channel filters have the same behavior in the worklog. So there is no change on this, since a channel uses either global or per-channel rewrite filters on a filter type. B) SQL commands: CHANGE REPLICATION FILTER ========================================== Dynamic replication filters are currently settable using the CHANGE REPLICATION FILTER statement. We extend this command to introduce dynamic replication filters per channel, by allowing a FOR CHANNEL <channel_name> clause as follows. ---- Syntax ---- CHANGE REPLICATION FILTER filter [, filter...] [FOR CHANNEL <channel_name>] filter: REPLICATE_DO_DB = (db_list) | REPLICATE_IGNORE_DB = (db_list) | REPLICATE_DO_TABLE = (tbl_list) | REPLICATE_IGNORE_TABLE = (tbl_list) | REPLICATE_WILD_DO_TABLE = (wild_tbl_list) | REPLICATE_WILD_IGNORE_TABLE = (wild_tbl_list) | REPLICATE_REWRITE_DB = (db_pair_list) ---- Semantics ---- 1) If an explicit FOR CHANNEL clause is provided, the statement acts on that configured slave replication channel removing any existing replication filter if it has the same filter type as one of specified replication filters, and replacing them with the specified ones. Filter types that were not explicitly listed in the statement are not modified. The statement is disallowed with an error 'ER_SLAVE_CONFIGURATION' on slave replication channel if it is not configured. The statement is disallowed with an error 'ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED' on group replication channels. 2) CHANGE REPLICATION FILTER filter [, filter...] with no FOR CHANNEL clause does the following, both for every configured slave replication channel's per-channel filter and for the global replication filters: For every filter type, if the filter type is listed in the statement, then any existing filter rules of that type are replaced by the filter rules specified in the statement, otherwise the old value of the type is retained. The statement does not act on group replication channels, because replication filters on group replication channels are disallowed. For example, C. SQL COMMAND: RESET SLAVE [ALL] [FOR CHANNEL] =============================================== 1) "RESET SLAVE FOR CHANNEL '<channel_name>'" does not remove the replication channel specified by 'FOR CHANNEL' clause, so it shall retain replication filters of the channel. It throws an error 'ER_SLAVE_CHANNEL_DOES_NOT_EXIST' if the channel does not exist. So this statement is not changed by the worklog. 2) "RESET SLAVE" does not remove any replication channel, so it shall retain all per-channel replication filters and all global replication filters. So this statement is not changed by the worklog. 3) "'RESET SLAVE ALL FOR CHANNEL '<channel_name>'" removes the replication channel specified by 'FOR CHANNEL' clause, so it shall remove all per-channel replication filters of the channel if the channel exists. Then SELECT * FROM performance_schema.replication_applier_filters and SHOW SLAVE STATUS proves there's no channel anymore and therefore its replication filters are gone too. It still throws an error 'ER_SLAVE_CHANNEL_DOES_NOT_EXIST' if the channel does not exist as before. 4) "RESET SLAVE ALL" with no FOR CHANNEL clause removes all replication channels, so it shall remove all per-channel replication filters but does not touch all global replication filters. When the new empty channel is being configured, it therefore uses the global replication filters (copies all global replication filters to its own per-channel replication filters). A user who wants to remove all global and per-channel filters can use the statement: CHANGE REPLICATION FILTER Replicate_Do_DB = (), Replicate_Ignore_DB = (), Replicate_Do_Table = (), Replicate_Ignore_Table = (), Replicate_Wild_Do_Table = (), Replicate_Wild_Ignore_Table = (), Replicate_Rewrite_DB = (). D. SQL COMMAND: SHOW SLAVE STATUS [FOR CHANNEL <channel_name>] ============================================================== SHOW SLAVE STATUS FOR CHANNEL <channel_name> shall show per-channel replication filters for the specified channel, or throw an error 'ER_SLAVE_CHANNEL_DOES_NOT_EXIST' if the channel does not exist. SHOW SLAVE STATUS with no FOR CHANNEL clause shall show the per-channel replication filters on every channel. E. CREATE A NEW performance_schema.replication_applier_filters ============================================================== We shall introduce a new dedicated P_S table to display per-channel replication filters for usability. So create and maintain the new P_S table with the following columns: 1) Channel_name: the name of the channel; 2) Filter_name: REPLICATE_DO_DB, REPLICATE_IGNORE_DB, REPLICATE_DO_TABLE, REPLICATE_IGNORE_TABLE, REPLICATE_WILD_DO_TABLE, REPLICATE_WILD_IGNORE_TABLE, REPLICATE_REWRITE_DB; 3) Filter_rule: The values that user has configured with startup options: --replicate-* or through CHANGE REPLICATION FILTER command (This also includes empty set when user unsets the rules). 4) Configured_by: ENUM(STARTUP_OPTIONS, CHANGE_REPLICATION_FILTER, STARTUP_OPTIONS_FOR_CHANNEL, CHANGE_REPLICATION_FILTER_FOR_CHANNEL); (These enumeration constants are the most self-descriptive set of identifiers, and supporting all the use cases: U1. Reflect the configured commands; U2. Determine if the filter has been persisted; U3. Debugging by a confused user, or learn the logic of default filters by playing with different ways to set them.) 5) Active_since: Timestamp of when the configuration took place; (To a new channel copying the global replication filters as its own per-channel filters, set 'active_since' to channel creation time.) 6) Counter: the hit counter of the filter since last configuration; Note: (4) and (5) are important to troubleshooting. (6) is more about statistics (and monitoring). F) CREATE A NEW performance_schema.replication_applier_global_filters ====================================================================== We shall introduce a new dedicated P_S table to display all global replication filters for usability. So create and maintain the new P_S table with the following columns: 1) Filter_name: REPLICATE_DO_DB, REPLICATE_IGNORE_DB, REPLICATE_DO_TABLE, REPLICATE_IGNORE_TABLE, REPLICATE_WILD_DO_TABLE, REPLICATE_WILD_IGNORE_TABLE, REPLICATE_REWRITE_DB; 2) Filter_rule: The values that user has configured with startup options: --replicate-* or through CHANGE REPLICATION FILTER command (This also includes empty set when user unsets the rules). 3) Configured_by: ENUM(STARTUP_OPTIONS, CHANGE_REPLICATION_FILTER); 4) Active_since: Timestamp of when the configuration took place;
1 parent c019294 commit e3e1cd1

File tree

90 files changed

+7401
-513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+7401
-513
lines changed

mysql-test/include/show_slave_status.inc

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# ==== Purpose ====
22
#
3-
# Show selected columns of output from SHOW SLAVE STATUS.
3+
# Show selected columns of output from SHOW SLAVE STATUS FOR CHANNEL channel.
44
#
5-
# Note: test cases should never call SHOW SLAVE STATUS directly,
6-
# because that outputs more information to the query log than what is
7-
# needed for the property that is being tested. That would cause
8-
# maintenance problems, because (1) it is hard for a human to
5+
# Note: test cases should never call SHOW SLAVE STATUS FOR CHANNEL channel,
6+
# directly, because that outputs more information to the query log than
7+
# what is needed for the property that is being tested. That would
8+
# cause maintenance problems, because (1) it is hard for a human to
99
# understand what property is being tested; (2) the output of many of
1010
# the fields is non-deterministic (e.g., Slave_IO_State) or changes
1111
# frequently (e.g., binlog positions).
@@ -78,6 +78,11 @@ if (!$status_items)
7878
--die Bug in test case: The mysqltest variable $status_items is not set.
7979
}
8080

81+
--let $_show_slave_status_channel= $rpl_channel_name
82+
if (!$rpl_channel_name)
83+
{
84+
--let $_show_slave_status_channel= ''
85+
}
8186

8287
--let $_slave_sql_mode= NO_BACKSLASH_ESCAPES
8388
if ($slave_sql_mode)

mysql-test/suite/perfschema/r/all_tests.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ update t2 set test_name= replace(test_name, "user_variables_", "uvar_");
2424
delete from t2 where t2.test_name in (select t1.test_name from t1);
2525
select test_name as `MISSING DDL/DML TESTS` from t2;
2626
MISSING DDL/DML TESTS
27+
idx_replication_applier_filters.test
28+
idx_replication_applier_global_filters.test
2729
drop table t1;
2830
drop table t2;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ALTER TABLE performance_schema.replication_applier_filters
2+
ADD COLUMN foo integer;
3+
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
4+
TRUNCATE TABLE performance_schema.replication_applier_filters;
5+
ERROR HY000: Invalid performance_schema usage.
6+
ALTER TABLE performance_schema.replication_applier_filters
7+
ADD INDEX test_index(filter_name);
8+
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
9+
CREATE UNIQUE INDEX test_index ON
10+
performance_schema.replication_applier_filters(filter_name);
11+
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ALTER TABLE performance_schema.replication_applier_global_filters
2+
ADD COLUMN foo integer;
3+
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
4+
TRUNCATE TABLE performance_schema.replication_applier_global_filters;
5+
ERROR HY000: Invalid performance_schema usage.
6+
ALTER TABLE performance_schema.replication_applier_global_filters
7+
ADD INDEX test_index(filter_name);
8+
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
9+
CREATE UNIQUE INDEX test_index ON
10+
performance_schema.replication_global_applier_filters(filter_name);
11+
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

mysql-test/suite/perfschema/r/dml_handler.result

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,105 +9,111 @@ SELECT COUNT(*) FROM table_list INTO @table_count;
99
# For each table in the performance schema, attempt HANDLER...OPEN,
1010
# which should fail with an error 1031, ER_ILLEGAL_HA.
1111

12-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=98;
12+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=100;
1313
HANDLER performance_schema.variables_info OPEN;
1414
ERROR HY000: Table storage engine for 'variables_info' doesn't have this option
15-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=97;
15+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=99;
1616
HANDLER performance_schema.variables_by_thread OPEN;
1717
ERROR HY000: Table storage engine for 'variables_by_thread' doesn't have this option
18-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=96;
18+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=98;
1919
HANDLER performance_schema.users OPEN;
2020
ERROR HY000: Table storage engine for 'users' doesn't have this option
21-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=95;
21+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=97;
2222
HANDLER performance_schema.user_variables_by_thread OPEN;
2323
ERROR HY000: Table storage engine for 'user_variables_by_thread' doesn't have this option
24-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=94;
24+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=96;
2525
HANDLER performance_schema.threads OPEN;
2626
ERROR HY000: Table storage engine for 'threads' doesn't have this option
27-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=93;
27+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=95;
2828
HANDLER performance_schema.table_lock_waits_summary_by_table OPEN;
2929
ERROR HY000: Table storage engine for 'table_lock_waits_summary_by_table' doesn't have this option
30-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=92;
30+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=94;
3131
HANDLER performance_schema.table_io_waits_summary_by_table OPEN;
3232
ERROR HY000: Table storage engine for 'table_io_waits_summary_by_table' doesn't have this option
33-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=91;
33+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=93;
3434
HANDLER performance_schema.table_io_waits_summary_by_index_usage OPEN;
3535
ERROR HY000: Table storage engine for 'table_io_waits_summary_by_index_usage' doesn't have this option
36-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=90;
36+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=92;
3737
HANDLER performance_schema.table_handles OPEN;
3838
ERROR HY000: Table storage engine for 'table_handles' doesn't have this option
39-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=89;
39+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=91;
4040
HANDLER performance_schema.status_by_user OPEN;
4141
ERROR HY000: Table storage engine for 'status_by_user' doesn't have this option
42-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=88;
42+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=90;
4343
HANDLER performance_schema.status_by_thread OPEN;
4444
ERROR HY000: Table storage engine for 'status_by_thread' doesn't have this option
45-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=87;
45+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=89;
4646
HANDLER performance_schema.status_by_host OPEN;
4747
ERROR HY000: Table storage engine for 'status_by_host' doesn't have this option
48-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=86;
48+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=88;
4949
HANDLER performance_schema.status_by_account OPEN;
5050
ERROR HY000: Table storage engine for 'status_by_account' doesn't have this option
51-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=85;
51+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=87;
5252
HANDLER performance_schema.socket_summary_by_instance OPEN;
5353
ERROR HY000: Table storage engine for 'socket_summary_by_instance' doesn't have this option
54-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=84;
54+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=86;
5555
HANDLER performance_schema.socket_summary_by_event_name OPEN;
5656
ERROR HY000: Table storage engine for 'socket_summary_by_event_name' doesn't have this option
57-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=83;
57+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=85;
5858
HANDLER performance_schema.socket_instances OPEN;
5959
ERROR HY000: Table storage engine for 'socket_instances' doesn't have this option
60-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=82;
60+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=84;
6161
HANDLER performance_schema.setup_timers OPEN;
6262
ERROR HY000: Table storage engine for 'setup_timers' doesn't have this option
63-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=81;
63+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=83;
6464
HANDLER performance_schema.setup_objects OPEN;
6565
ERROR HY000: Table storage engine for 'setup_objects' doesn't have this option
66-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=80;
66+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=82;
6767
HANDLER performance_schema.setup_instruments OPEN;
6868
ERROR HY000: Table storage engine for 'setup_instruments' doesn't have this option
69-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=79;
69+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=81;
7070
HANDLER performance_schema.setup_consumers OPEN;
7171
ERROR HY000: Table storage engine for 'setup_consumers' doesn't have this option
72-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=78;
72+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=80;
7373
HANDLER performance_schema.setup_actors OPEN;
7474
ERROR HY000: Table storage engine for 'setup_actors' doesn't have this option
75-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=77;
75+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=79;
7676
HANDLER performance_schema.session_variables OPEN;
7777
ERROR HY000: Table storage engine for 'session_variables' doesn't have this option
78-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=76;
78+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=78;
7979
HANDLER performance_schema.session_status OPEN;
8080
ERROR HY000: Table storage engine for 'session_status' doesn't have this option
81-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=75;
81+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=77;
8282
HANDLER performance_schema.session_connect_attrs OPEN;
8383
ERROR HY000: Table storage engine for 'session_connect_attrs' doesn't have this option
84-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=74;
84+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=76;
8585
HANDLER performance_schema.session_account_connect_attrs OPEN;
8686
ERROR HY000: Table storage engine for 'session_account_connect_attrs' doesn't have this option
87-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=73;
87+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=75;
8888
HANDLER performance_schema.rwlock_instances OPEN;
8989
ERROR HY000: Table storage engine for 'rwlock_instances' doesn't have this option
90-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=72;
90+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=74;
9191
HANDLER performance_schema.replication_group_members OPEN;
9292
ERROR HY000: Table storage engine for 'replication_group_members' doesn't have this option
93-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=71;
93+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=73;
9494
HANDLER performance_schema.replication_group_member_stats OPEN;
9595
ERROR HY000: Table storage engine for 'replication_group_member_stats' doesn't have this option
96-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=70;
96+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=72;
9797
HANDLER performance_schema.replication_connection_status OPEN;
9898
ERROR HY000: Table storage engine for 'replication_connection_status' doesn't have this option
99-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=69;
99+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=71;
100100
HANDLER performance_schema.replication_connection_configuration OPEN;
101101
ERROR HY000: Table storage engine for 'replication_connection_configuration' doesn't have this option
102-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=68;
102+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=70;
103103
HANDLER performance_schema.replication_applier_status_by_worker OPEN;
104104
ERROR HY000: Table storage engine for 'replication_applier_status_by_worker' doesn't have this option
105-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=67;
105+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=69;
106106
HANDLER performance_schema.replication_applier_status_by_coordinator OPEN;
107107
ERROR HY000: Table storage engine for 'replication_applier_status_by_coordinator' doesn't have this option
108-
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=66;
108+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=68;
109109
HANDLER performance_schema.replication_applier_status OPEN;
110110
ERROR HY000: Table storage engine for 'replication_applier_status' doesn't have this option
111+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=67;
112+
HANDLER performance_schema.replication_applier_global_filters OPEN;
113+
ERROR HY000: Table storage engine for 'replication_applier_global_filters' doesn't have this option
114+
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=66;
115+
HANDLER performance_schema.replication_applier_filters OPEN;
116+
ERROR HY000: Table storage engine for 'replication_applier_filters' doesn't have this option
111117
SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=65;
112118
HANDLER performance_schema.replication_applier_configuration OPEN;
113119
ERROR HY000: Table storage engine for 'replication_applier_configuration' doesn't have this option
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SELECT * FROM performance_schema.replication_applier_filters
2+
LIMIT 1;
3+
INSERT INTO performance_schema.replication_applier_filters
4+
SET COUNTER=2;
5+
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'replication_applier_filters'
6+
UPDATE performance_schema.replication_applier_filters
7+
SET COUNTER=12 WHERE COUNTER=0;
8+
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'replication_applier_filters'
9+
DELETE FROM performance_schema.replication_applier_filters
10+
WHERE COUNTER=0;
11+
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'replication_applier_filters'
12+
DELETE FROM performance_schema.replication_applier_filters;
13+
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'replication_applier_filters'
14+
LOCK TABLES performance_schema.replication_applier_filters READ;
15+
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'replication_applier_filters'
16+
UNLOCK TABLES;
17+
LOCK TABLES performance_schema.replication_applier_filters WRITE;
18+
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'replication_applier_filters'
19+
UNLOCK TABLES;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SELECT * FROM performance_schema.replication_applier_global_filters
2+
LIMIT 1;
3+
INSERT INTO performance_schema.replication_applier_global_filters
4+
SET COUNTER=2;
5+
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'replication_applier_global_filters'
6+
UPDATE performance_schema.replication_applier_global_filters
7+
SET COUNTER=12 WHERE COUNTER=0;
8+
ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'replication_applier_global_filters'
9+
DELETE FROM performance_schema.replication_applier_global_filters
10+
WHERE COUNTER=0;
11+
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'replication_applier_global_filters'
12+
DELETE FROM performance_schema.replication_applier_global_filters;
13+
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'replication_applier_global_filters'
14+
LOCK TABLES performance_schema.replication_applier_global_filters READ;
15+
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'replication_applier_global_filters'
16+
UNLOCK TABLES;
17+
LOCK TABLES performance_schema.replication_applier_global_filters WRITE;
18+
ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'replication_applier_global_filters'
19+
UNLOCK TABLES;

mysql-test/suite/perfschema/r/dml_setup_instruments.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ wait/synch/rwlock/sql/Binlog_storage_delegate::lock YES YES
2424
wait/synch/rwlock/sql/Binlog_transmit_delegate::lock YES YES
2525
wait/synch/rwlock/sql/channel_lock YES YES
2626
wait/synch/rwlock/sql/channel_map_lock YES YES
27+
wait/synch/rwlock/sql/channel_to_filter_lock YES YES
2728
wait/synch/rwlock/sql/gtid_commit_rollback YES YES
2829
wait/synch/rwlock/sql/gtid_mode_lock YES YES
2930
wait/synch/rwlock/sql/gtid_retrieved YES YES
3031
wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES
31-
wait/synch/rwlock/sql/LOCK_sys_init_connect YES YES
3232
select * from performance_schema.setup_instruments
3333
where name like 'Wait/Synch/Cond/sql/%'
3434
and name not in (

mysql-test/suite/perfschema/r/information_schema.result

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ performance_schema performance_timers def
6767
performance_schema persisted_variables def
6868
performance_schema prepared_statements_instances def
6969
performance_schema replication_applier_configuration def
70+
performance_schema replication_applier_filters def
71+
performance_schema replication_applier_global_filters def
7072
performance_schema replication_applier_status def
7173
performance_schema replication_applier_status_by_coordinator def
7274
performance_schema replication_applier_status_by_worker def
@@ -169,6 +171,8 @@ performance_timers BASE TABLE PERFORMANCE_SCHEMA
169171
persisted_variables BASE TABLE PERFORMANCE_SCHEMA
170172
prepared_statements_instances BASE TABLE PERFORMANCE_SCHEMA
171173
replication_applier_configuration BASE TABLE PERFORMANCE_SCHEMA
174+
replication_applier_filters BASE TABLE PERFORMANCE_SCHEMA
175+
replication_applier_global_filters BASE TABLE PERFORMANCE_SCHEMA
172176
replication_applier_status BASE TABLE PERFORMANCE_SCHEMA
173177
replication_applier_status_by_coordinator BASE TABLE PERFORMANCE_SCHEMA
174178
replication_applier_status_by_worker BASE TABLE PERFORMANCE_SCHEMA
@@ -271,6 +275,8 @@ performance_timers 10 Fixed
271275
persisted_variables 10 Dynamic
272276
prepared_statements_instances 10 Dynamic
273277
replication_applier_configuration 10 Fixed
278+
replication_applier_filters 10 Dynamic
279+
replication_applier_global_filters 10 Dynamic
274280
replication_applier_status 10 Fixed
275281
replication_applier_status_by_coordinator 10 Dynamic
276282
replication_applier_status_by_worker 10 Dynamic
@@ -371,6 +377,8 @@ objects_summary_global_by_type NULL
371377
performance_timers NULL
372378
prepared_statements_instances NULL
373379
replication_applier_configuration NULL
380+
replication_applier_filters NULL
381+
replication_applier_global_filters NULL
374382
replication_applier_status NULL
375383
replication_applier_status_by_coordinator NULL
376384
replication_applier_status_by_worker NULL
@@ -481,6 +489,8 @@ performance_timers NULL NULL
481489
persisted_variables NULL NULL
482490
prepared_statements_instances NULL NULL
483491
replication_applier_configuration NULL NULL
492+
replication_applier_filters NULL NULL
493+
replication_applier_global_filters NULL NULL
484494
replication_applier_status NULL NULL
485495
replication_applier_status_by_coordinator NULL NULL
486496
replication_applier_status_by_worker NULL NULL
@@ -583,6 +593,8 @@ performance_timers NULL NULL NULL
583593
persisted_variables NULL NULL NULL
584594
prepared_statements_instances NULL NULL NULL
585595
replication_applier_configuration NULL NULL NULL
596+
replication_applier_filters NULL NULL NULL
597+
replication_applier_global_filters NULL NULL NULL
586598
replication_applier_status NULL NULL NULL
587599
replication_applier_status_by_coordinator NULL NULL NULL
588600
replication_applier_status_by_worker NULL NULL NULL
@@ -685,6 +697,8 @@ performance_timers NULL NULL NULL
685697
persisted_variables NULL NULL NULL
686698
prepared_statements_instances NULL NULL NULL
687699
replication_applier_configuration NULL NULL NULL
700+
replication_applier_filters NULL NULL NULL
701+
replication_applier_global_filters NULL NULL NULL
688702
replication_applier_status NULL NULL NULL
689703
replication_applier_status_by_coordinator NULL NULL NULL
690704
replication_applier_status_by_worker NULL NULL NULL
@@ -787,6 +801,8 @@ performance_timers utf8_general_ci NULL
787801
persisted_variables utf8_general_ci NULL
788802
prepared_statements_instances utf8_general_ci NULL
789803
replication_applier_configuration utf8_general_ci NULL
804+
replication_applier_filters utf8_general_ci NULL
805+
replication_applier_global_filters utf8_general_ci NULL
790806
replication_applier_status utf8_general_ci NULL
791807
replication_applier_status_by_coordinator utf8_general_ci NULL
792808
replication_applier_status_by_worker utf8_general_ci NULL
@@ -889,6 +905,8 @@ performance_timers
889905
persisted_variables
890906
prepared_statements_instances
891907
replication_applier_configuration
908+
replication_applier_filters
909+
replication_applier_global_filters
892910
replication_applier_status
893911
replication_applier_status_by_coordinator
894912
replication_applier_status_by_worker
@@ -991,6 +1009,8 @@ performance_timers
9911009
persisted_variables
9921010
prepared_statements_instances
9931011
replication_applier_configuration
1012+
replication_applier_filters
1013+
replication_applier_global_filters
9941014
replication_applier_status
9951015
replication_applier_status_by_coordinator
9961016
replication_applier_status_by_worker

0 commit comments

Comments
 (0)