Description:
There is an issue with the "CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB" item.
According to the docs, if you are using row based replication then only the affected databases should be checked to see if it should be ignored, and the "default" database should have no bearing.
But if I do the following on the source database:
use db1;
create table db2.tabname;
where db2 should be ignored on the replica due to "CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB = (db2)", the table db2.tabname is still created.
How to repeat:
Set up a simple Source / Replica set up.
Confirm ROW based replication is in effect on both databases:
show global variables like 'binlog_format'; # ROW
On source database run "create schema db2"
Confirm, db2 exists on the replica.
On the Replica database run:
STOP REPLICA SQL_THREAD;
CHANGE REPLICATION FILTER REPLICATE_IGNORE_DB = (db2);
START REPLICA SQL_THREAD;
confirm with:
show replica status;
now back on the source database run:
use db2;
CREATE TABLE `db2`.`tab1` (
`id` INT NOT NULL,
PRIMARY KEY (`id`));
On the Replica check if the table db2.tab1 exists. (it doesn't).
On the source drop the table.
drop table `db2`.`tab1`;
Now, still on the source run:
USE some_other_database;
CREATE TABLE `db2`.`tab1` (
`id` INT NOT NULL,
PRIMARY KEY (`id`));
now check on the replica database, to see if the table exists (it does).
But according to the documentation, this shouldn't be the case:
"Which logging format is used?
STATEMENT. Test the default database.
ROW. Test the database affected by the changes."
Suggested fix:
ignore the default database as described in the documentation.