Galera MySql Triggers problem

362 views
Skip to first unread message

Karoly Guba

unread,
Dec 19, 2016, 5:17:18 AM12/19/16
to codership
Hi Everyone!

I work for a company who's data is stored in the mysql database. The company has many apps which connected to the standalone mysql db in the past, and since the number of apps is growing, the mysql db couldn't properly handle the huge load, that is why we decided to use Galera Cluster. 
We have been using Galera for two weeks now and I am glad to have it. It works good, the load is balanced now to tree mysql nodes. 

The only thing what worries me is the database triggers. One part of the app relies on the database triggers. 
My trigger:
CREATE DEFINER=`root`@`%` TRIGGER order_UPDATE_trigger
AFTER UPDATE ON order
FOR EACH ROW
BEGIN
DECLARE id CHAR(20);
DECLARE event varchar(255);
IF (NEW.enabled > 0 OR OLD.enabled > 0)  THEN
SET id=NEW.id;
SET event = concat("DB:","order :", "update :",  id);
INSERT IGNORE INTO order_events set event = event;
END IF;
END

It should trigger an event (put a record into the order_event table whenever the order table has changed).
My experience:
Sometimes (there is no rule when), when I change order table (and enabled field is greater than 0), no event is triggered, then suddenly triggers starts to work properly. 

Is there any specific configuration in Galera to database triggers? Is there any limitations/known issues about triggers in Galera-mysql cluster?

Thanks in advance,
Karoly


Philip Stoev

unread,
Dec 19, 2016, 5:20:33 AM12/19/16
to Karoly Guba, codersh...@googlegroups.com
Hello,

Are you using Galera in single-master or multi-master mode?

Philip Stoev
--
You received this message because you are subscribed to the Google Groups
"codership" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to codership-tea...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karoly Guba

unread,
Dec 19, 2016, 5:30:30 AM12/19/16
to codership, guba....@gmail.com
Hi Philip!

Thanks for the prompt answer!

To answer your question I use Galera in multi-master mode.

Philip Stoev

unread,
Dec 20, 2016, 11:24:31 AM12/20/16
to Karoly Guba, codership, guba....@gmail.com
Hello,

We suspect that what you are observing may be an issue that was discovered
recently and will be fixed in the next Galera Cluster release.

To confirm that this is the case, can you please try to modify your trigger
to not use IGNORE in the INSERT statement? Once you remove the IGNORE
modifier, your application may begin to experience additional deadlock
errors. Those are genuine transaction conflicts that were previously not
reported because of a bug in the handling of the IGNORE modifier.

Thank you.

Ioannis Venizelos

unread,
Mar 3, 2017, 5:44:02 AM3/3/17
to codership, guba....@gmail.com
Hello,
The bug you named in the handling of the IGNORE modifier, affect the
Server version: 5.5.41 , wsrep version 25.12 ?
Reply all
Reply to author
Forward
0 new messages