Bug #106317 CHANGE REPLICATION FILTER does not persist after restart
Submitted: 27 Jan 2022 22:39 Modified: 28 Jan 2022 4:40
Reporter: Sveta Smirnova (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7, 8.0 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[27 Jan 2022 22:39] Sveta Smirnova
Description:
According to https://dev.mysql.com/doc/refman/8.0/en/change-replication-filter.html:

> CHANGE REPLICATION FILTER sets one or more replication filtering rules on the replica in the same way as starting the replica mysqld with replication filtering options such as --replicate-do-db or --replicate-wild-ignore-table. Unlike the case with the server options, this statement does not require restarting the server to take effect, only that the replication SQL thread be stopped using STOP REPLICA SQL_THREAD first (and restarted with START REPLICA SQL_THREAD afterwards). 

However, this page does not say that these filters will be removed after replica restart. I expect it to work the same way as CHANGE REPLICATION SOURCE ... command and store these parameters somewhere. However, this is not the case.

How to repeat:
1. Create MTR test case

$ cat ~/src/tests/t/rpl_PS-8060.test 
--source include/master-slave.inc

--connection slave
STOP REPLICA;
CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB = ( test1, test2 );
START REPLICA;
SELECT FILTER_NAME, FILTER_RULE FROM performance_schema.replication_applier_filters;

--let $allow_rpl_inited = 1
--source include/restart_mysqld.inc

#START REPLICA;
SELECT FILTER_NAME, FILTER_RULE FROM performance_schema.replication_applier_filters;
#STOP REPLICA;
RESET REPLICA ALL;

2. Put it into mysql-test/t, and run it:

./mtr rpl_PS-8060

3. Find that performance_schema.replication_applier_filters has

FILTER_NAME	FILTER_RULE
REPLICATE_IGNORE_DB	test1,test2

before restart and nothing after it.

Suggested fix:
Persist replication filters or update documentation.
[28 Jan 2022 4:40] MySQL Verification Team
Hello Sveta,

Thank you for the report and feedback.

regards,
Umesh
[21 Mar 2022 9:53] Sven Sandberg
Posted by developer:
 
Thank you for the bug report. You are right, replication filters created with CREATE REPLICATION FILTER are not persisted. This is expected (although not optimal) - see WL#7057 design. Hence, marking this as a documentation bug.
[21 Mar 2022 23:40] Jon Stephens
Thanks, Sveta!

Fixed in the 5.7/8.0 documentation, in mysqldoc rev 72385. Changes should appear online soon.

Closed.