Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 10.1.1
    • Fix Version/s: N/A
    • Component/s: Replication
    • Labels:
      None
    • Environment:
      Linux 2.6.32-220.17.1.el6.x86_64 #1 SMP Wed May 16 00:01:37 BST 2012 x86_64 x86_64 x86_64 GNU/Linux

      Description

      When slave_run_trigger_for_rbr is set to logging on the slave, does it mean triggers can be fired only on the slave? In our test case it works when the trigger is on the slave, but we do have users who has triggers on master as well and we hope it can work on both cases, but right now it looks like the change made by triggers on master can not be replicated to the slave, we get an error
      Last_SQL_Error: Could not execute Write_rows_v1 event on table tsom.z; Can't update table 'xx' in stored function/trigger because it is already used by statement which invoked this stored function/trigger., Error_code: 1442; handler error HA_ERR_GENERIC; the event's master log mysql-bin.000045, end_log_pos 2776

      the master is on MySQL 5.5.39 while the slave is on MariaDB 10.1.1.

      mysql 00:08:45 [PA1 DEV 001] [tsom] [3101]> select @@version;
      +---------------------------------+
      | @@version                       |
      +---------------------------------+
      | 5.5.39-tokudb-7.5.0-MariaDB-log |
      +---------------------------------+
      mysql 00:09:02 [PA1 DEV 001] [tsom] [3108]> select @@version;
      +--------------------------+
      | @@version                |
      +--------------------------+
      | 10.1.1-MariaDB-wsrep-log |
      +--------------------------+
      

      Is this working as designed?

      Thank you.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            sanja Oleksandr Byelkin added a comment -

            Actually, RBR triggers do not run for tables which already have any trigger run on master but it is done silently. Could you provide more detailed test suite for the error then I'll be more certain if it is bug or not.

            Show
            sanja Oleksandr Byelkin added a comment - Actually, RBR triggers do not run for tables which already have any trigger run on master but it is done silently. Could you provide more detailed test suite for the error then I'll be more certain if it is bug or not.
            Hide
            dyan Daisy Yan added a comment - - edited

            It's just a regular trigger on the master. What we were trying to test is, since we do have some only-on-slave triggers, we want to turn on slave_run_trigger_for_rbr, but we also want to make sure the current running triggers on master would still be able to replicate their data changes to the slave through rbr.

            The test case is, on master a trigger on table z

             CREATE DEFINER=`root`@`localhost` trigger tsom.insertz after insert on tsom.z FOR EACH ROW insert  tsom.xx values(0) 
            
            mysql 16:43:45 [PA1 DEV 001] [tsom] [3101]> show create table z;
            +-------+------------------------------------------------------------------------------------+
            | Table | Create Table                                                                       |
            +-------+------------------------------------------------------------------------------------+
            | z     | CREATE TABLE `z` (
              `c` int(11) DEFAULT NULL
            ) ENGINE=TokuDB DEFAULT CHARSET=utf8 |
            +-------+------------------------------------------------------------------------------------+
            1 row in set (0.00 sec)
            
            mysql 16:43:51 [PA1 DEV 001] [tsom] [3101]> show create table xx;
            +-------+-------------------------------------------------------------------------------------+
            | Table | Create Table                                                                        |
            +-------+-------------------------------------------------------------------------------------+
            | xx    | CREATE TABLE `xx` (
              `a` int(11) DEFAULT NULL
            ) ENGINE=TokuDB DEFAULT CHARSET=utf8 |
            +-------+-------------------------------------------------------------------------------------+
            1 row in set (0.00 sec)
            
            table z and xx are also on the slave already
            
            insert into z values(1);
            

            on the slave, we got

                           Last_SQL_Error: Could not execute Write_rows_v1 event on table tsom.z; Can't update table 'xx' in stored function/trigger because it is already used by statement which invoked this stored function/trigger., Error_code: 1442; handler error HA_ERR_GENERIC; the event's master log mysql-bin.000045, end_log_pos 2776
            

            On slave we got no insert on either z or xx

            Show
            dyan Daisy Yan added a comment - - edited It's just a regular trigger on the master. What we were trying to test is, since we do have some only-on-slave triggers, we want to turn on slave_run_trigger_for_rbr, but we also want to make sure the current running triggers on master would still be able to replicate their data changes to the slave through rbr. The test case is, on master a trigger on table z CREATE DEFINER=`root`@`localhost` trigger tsom.insertz after insert on tsom.z FOR EACH ROW insert tsom.xx values(0) mysql 16:43:45 [PA1 DEV 001] [tsom] [3101]> show create table z; +-------+------------------------------------------------------------------------------------+ | Table | Create Table | +-------+------------------------------------------------------------------------------------+ | z | CREATE TABLE `z` ( `c` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=utf8 | +-------+------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql 16:43:51 [PA1 DEV 001] [tsom] [3101]> show create table xx; +-------+-------------------------------------------------------------------------------------+ | Table | Create Table | +-------+-------------------------------------------------------------------------------------+ | xx | CREATE TABLE `xx` ( `a` int(11) DEFAULT NULL ) ENGINE=TokuDB DEFAULT CHARSET=utf8 | +-------+-------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) table z and xx are also on the slave already insert into z values(1); on the slave, we got Last_SQL_Error: Could not execute Write_rows_v1 event on table tsom.z; Can't update table 'xx' in stored function/trigger because it is already used by statement which invoked this stored function/trigger., Error_code: 1442; handler error HA_ERR_GENERIC; the event's master log mysql-bin.000045, end_log_pos 2776 On slave we got no insert on either z or xx
            Hide
            dyan Daisy Yan added a comment -

            The insert into z values(1) was executed on the master

            Show
            dyan Daisy Yan added a comment - The insert into z values(1) was executed on the master
            Hide
            elenst Elena Stepanova added a comment -

            Oleksandr Byelkin, please note that the master is 5.5.39, so if the decision whether to run RBR triggers or not depends on some new flag the master is supposed to write in the binlog, this master is probably not capable of it.

            Show
            elenst Elena Stepanova added a comment - Oleksandr Byelkin , please note that the master is 5.5.39, so if the decision whether to run RBR triggers or not depends on some new flag the master is supposed to write in the binlog, this master is probably not capable of it.
            Hide
            dyan Daisy Yan added a comment -

            I've changed the master to 10.0.13, I'm still getting the same error. Does this mean we have to upgrade master to 10.1.1 as well? We were hoping to only have this version run on slave first.

            Show
            dyan Daisy Yan added a comment - I've changed the master to 10.0.13, I'm still getting the same error. Does this mean we have to upgrade master to 10.1.1 as well? We were hoping to only have this version run on slave first.
            Hide
            dyan Daisy Yan added a comment -

            Is there any update on this? Thanks.

            Show
            dyan Daisy Yan added a comment - Is there any update on this? Thanks.
            Hide
            sanja Oleksandr Byelkin added a comment -

            RBR triggers was implemented in 10.1.1 so versions before it can't somehow inform slave that they had triggers run. So I doubts that the problem can be fixed.

            Show
            sanja Oleksandr Byelkin added a comment - RBR triggers was implemented in 10.1.1 so versions before it can't somehow inform slave that they had triggers run. So I doubts that the problem can be fixed.

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                dyan Daisy Yan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: