Bug #68597 | Trigger on slave is not working with master tx_isolation as "READ_COMMITTED" | ||
---|---|---|---|
Submitted: | 7 Mar 2013 12:27 | Modified: | 21 Mar 2013 19:02 |
Reporter: | kuntal basu | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S1 (Critical) |
Version: | 5.5.29 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | READ-COMMITTED, triggers |
[7 Mar 2013 12:27]
kuntal basu
[7 Mar 2013 12:37]
Valeriy Kravchuk
Please, send the output of: show variables like 'binlog_f%'; from your master. If it is MIXED, try to set STATEMENT maybe.
[7 Mar 2013 12:51]
kuntal basu
I have already tried that also.It is not working..
[7 Mar 2013 12:54]
kuntal basu
Here is the output.. The insert itself is not working Database changed mysql> show variables like 'binlog_f%'; +---------------+-----------+ | Variable_name | Value | +---------------+-----------+ | binlog_format | STATEMENT | +---------------+-----------+ 1 row in set (0.02 sec) mysql> insert into test_trig_orig values ('debannjan_read_statement'); ERROR 1665 (HY000): Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. mysql>
[8 Mar 2013 10:49]
kuntal basu
Need help on a urgent basis.on the same. Any workaround or changes. Please advice.
[13 Mar 2013 10:31]
kuntal basu
Please provide an update
[16 Mar 2013 17:58]
MySQL Verification Team
What you see is explainable. When using ROW based replication, which innodb will use when read committed is enabled, triggers aren't fired on slave. http://dev.mysql.com/doc/refman/5.6/en/replication-features-triggers.html "With row-based replication, triggers executed on the master do not execute on the slave." http://dev.mysql.com/doc/refman/5.6/en/binary-log-setting.html "If you are using InnoDB tables and the transaction isolation level is READ COMMITTED or READ UNCOMMITTED, only row-based logging can be used."
[16 Mar 2013 21:22]
kuntal basu
Hi Shane Bester, Yes you are correct, but if you have gone through my description, this trigger is not there in the master at all. I am not trying to run a trigger which is there in master, I know that is a replication feature otherwise there could be a duplicate row scenario hence ""With row-based replication, triggers executed on the master do not execute on the slave."" does not even comes into picture. This trigger is PURELY ON SLAVE and I was expecting that this trigger will act on the slave whenever replication insert/update any table in slave. Regarding your second point yes, I know that also, but just cross check as that one has came as a suggestion. Hope this clarifies.
[16 Mar 2013 21:25]
kuntal basu
Hi MySQL developers, Can I have an reply, It is stopping me to implement as architecture, If I am sure that I am doing something wrong or this one is a MYSQL bug I can try some other ways, Kindly update status.
[21 Mar 2013 19:02]
Sveta Smirnova
Thank you for the feedback. This is how row-based replication works: it stores in the binary log only modified rows and not the statement which fired them. This behavior is by design. To solve your problem you can have events on slave which will read modified rows in the table and do same job as your trigger supposed to do.