[MDEV-6471] Replicate_Wild_Ignore_Table not working well Created: 2014-07-22  Updated: 2014-08-03  Resolved: 2014-08-03

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.37
Fix Version/s: 5.5.39

Type: Bug Priority: Minor
Reporter: Tomas Matejicek Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: documentation, replication
Environment:

Slackware Linux 14.1


Attachments: File server.cnf    

 Description   

I have a MySQL master server, lets call it MYSQL.
Furthermore I have another server, which runs MariaDB. Let's call it MariaDB.

MariaDB server acts as a slave. I have the following in /etc/my.cnf.d/server.cnf:

replicate-wild-ignore-table = %.trades,%.cacheable,mysql.user

I can confirm that SHOW SLAVE STATUS shows this:
Replicate_Wild_Ignore_Table: %.trades,%.cacheable,mysql.user

However, the slave MariaDB server replicates everything from MYSQL master, even the tables which it shouldn't. However, if I execute the following commands on MariaDB slave, it magically starts to work correctly (replicates only the tables not mentioned in wild ignore):

STOP SLAVE;
set global replicate_wild_ignore_table="%.trades,%.cacheable,mysql.user";
START SLAVE;

Again, show slave status still reports the same:
Replicate_Wild_Ignore_Table: %.trades,%.cacheable,mysql.user

I consider this a bug. It should ignore the tables in replication right from the start. By the way, if that matters, the mariadb slave is also configured to store statements in its binary log (as like it will be used as master some time later). Just a note. Attached is the content of file /etc/my.cnf.d/server.cnf (copy&pasted in windows, so probably with wrong CRLF newlines, ignore that)



 Comments   
Comment by Elena Stepanova [ 2014-07-22 ]

Hi,

Did you try to configure it according to the documentation?
https://mariadb.com/kb/en/mariadb/mariadb-documentation/replication-cluster-multi-master/replication/replication-and-binary-log-server-system-variables/#replicate_wild_ignore_table

replicate_wild_ignore_table

Description: Slave threads will be prohibited from replicating tables that match the specified wildcard pattern. For example replicate-wild-ignore-table=foo%.bar% will not do updates to tables in databases that start with foo and whose table names start with bar. Will work with cross-database updates. The commandline directive does not accept a comma-delimited list, and needs to be used multiple times to specify multiple wildcard patterns.

Comment by Tomas Matejicek [ 2014-07-22 ]

Hello, thank you very much for your suggestion. I've already read the documentation and noticed that the command line directive does not accept coma-delimited list. However as I explained in the bug report, I am not specifying wild ignore parameters in command line, but rather in MariaDB configuration file /etc/my.cnf.d/server.cnf

So I tried to do similar thing in the config file, I put there three lines:

replicate-wild-ignore-table = %.trades
replicate-wild-ignore-table = %.cacheable
replicate-wild-ignore-table = mysql.user

After the MariaDB server is restarted, this works - the mentioned tables are indeed ignored during replication, that is what I want.
So I think that either the documentation should be updated so the user understands that he can actually put three these lines in config file, or the MariaDB code should be modified so it accepts comma-delimited list of parameters through the config file.

Thanks

Comment by Elena Stepanova [ 2014-07-23 ]

Ian,

Could you please somehow address it and re-phrase the description?
It's presumed and usually understood that what's true for a command-line option is also true for the same option put in a config file, but apparently it's not obvious.

Comment by Tomas Matejicek [ 2014-07-23 ]

One note to add though.
When the wild ignore tables are specified in config file as comma-delimited list, MariaDB doesn't properly ignore the tables, BUT issuing the "SHOW SLAVE STATUS" statement still shows the comma-delimited list in Replicate_Wild_Ignore_Table: %.trades,%.cacheable,mysql.user ... And the output is the very same as like if the tables are specified one by one. That's confusing.

From my point of view, if mariaDB doesn't understand the comma-delimited list, it SHOULD NOT print that list in SHOW SLAVE STATUS output in the same way as like if it understood it, because in that case people may think that the server understood the list and accepted it, which is not the case.

So updating the documentation is one thing, but fixing the server code is IMHO still necessary, to better handle the situation.

Comment by Elena Stepanova [ 2014-07-23 ]

MariaDB (and MySQL, for that matter) understands the list, but it treats it as a single schema name, because a schema name can contain commas. It is specifically documented in MySQL manual.

See http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html

To specify multiple databases you must use multiple instances of this option. Because database names can contain commas, if you supply a comma separated list then the list will be treated as the name of a single database.

SHOW SLAVE STATUS also in this case shows a single schema name containing commas.

Comment by Ian Gilfillan [ 2014-07-24 ]

The documentation has been updated.

Generated at Thu Feb 08 07:12:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.