MariaDB Replication: trigger not executed in slave table if master table contains any triggers

https://mariadb.com/kb/en/library/running-triggers-on-the-slave-for-row-based-events/ states that: "There is a basic protection against triggers being invoked both on the master and slave. If the master modifies a table that has triggers, it will produce row-based binlog events with the "triggers were invoked for this event" flag. The slave will not invoke any triggers for flagged events."

I have a delete trigger in the table in master (and slave of course) to clean up related tables. Then I add other triggers (insert, update, delete) in the slave table to get some change history logging done there.

None of the slave triggers get executed unless I drop the original delete trigger in master. If master table does not contain any triggers then the slave-only triggers work just fine.

Isn't there any way to get the slave to execute those extra triggers while keeping the original trigger in master?

The triggers are of course named differently so binlog event could say that "trigger xxx was invoked for this event" for which there is no need to execute in slave. Other trigger named yyy which was not invoked in master could then be executed in slave.

Answer Answered by Andrei Elkin in this comment.

None of the slave triggers get executed unless I drop the original delete trigger in master. If master table does not contain any triggers then the slave-only triggers work just fine.

Sorry, I could not get the meaning. Do you mean that when you tried creating a trigger on the slave this sort of error happened?

ERROR 1235 (42000): This version of MariaDB doesn't yet support 'multiple triggers with the same action time and event for one table'

As to enable on slave only some of the triggers, like in your use case those that are only define for the slave side, the answer is NO.

Feel free to suggest a feature request on Jira and also describe in details suspiciously looking 'None of the slave triggers get executed unless I drop the original delete trigger in master'.

Thank you for your questions!

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.