Triggers and Galera

361 views
Skip to first unread message

James Wang

unread,
Nov 10, 2015, 4:07:14 AM11/10/15
to codership
Hi All,

I have a trigger which inserts/updates a record in another table (say b) once there is a new entry in one table (say a).

Currently, this trigger is set on all nodes and I am not sure if this is correct for the following scenery:

1). a record is inserted in table a on, say node 1
2). the trigger insert a record in table b on node 1
3). Galera replicates the new record in table a on, say node 2
4). Galera replicates the new record in table b on node 2
5). At the same time, will the trigger on node 2 will insert a new record to table b on node 2 please?

Please help.

Thanks a lot in advance

Daniel Black

unread,
Nov 10, 2015, 7:45:53 AM11/10/15
to James Wang, codership-team
If you read the documentation on triggers and row based replication you will know your answer.

Alternately you could try and see and observe the results. Use log-slave-updates and looking at the binary log will also provide illumination.


--
--
Daniel Black, Engineer @ Open Query (http://openquery.com.au)
Remote expertise & maintenance for MySQL/MariaDB server environments.

James Wang

unread,
Nov 10, 2015, 8:00:33 AM11/10/15
to codership, jwang...@gmail.com, daniel...@openquery.com.au
Hi Daniel,

Thanks a lot for the advice.  I am reading this page:

However, my table seam did not show any duplicates.  Also, I am setting up a testing environment with no Galera (just standard Master-Slave) and see if I can record duplicates in row-based replication.

Thanks
Reply all
Reply to author
Forward
0 new messages