Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6471

Replicate_Wild_Ignore_Table not working well

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.5.37
    • Fix Version/s: 5.5.39
    • Component/s: None
    • Environment:
      Slackware Linux 14.1

      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)

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            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.

            Show
            elenst Elena Stepanova added a comment - 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 .
            Hide
            TomasM Tomas Matejicek added a comment -

            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

            Show
            TomasM Tomas Matejicek added a comment - 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
            Hide
            elenst Elena Stepanova added a comment -

            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.

            Show
            elenst Elena Stepanova added a comment - 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.
            Hide
            TomasM Tomas Matejicek added a comment -

            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.

            Show
            TomasM Tomas Matejicek added a comment - 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.
            Hide
            elenst Elena Stepanova added a comment -

            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.

            Show
            elenst Elena Stepanova added a comment - 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.
            Hide
            greenman Ian Gilfillan added a comment -

            The documentation has been updated.

            Show
            greenman Ian Gilfillan added a comment - The documentation has been updated.

              People

              • Assignee:
                greenman Ian Gilfillan
                Reporter:
                TomasM Tomas Matejicek
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 hour
                  1h
                  Remaining:
                  Remaining Estimate - 1 hour
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified