0

We currently use a trigger on our MySQL database that sets a "last-modified" timestamp to CURRENT_TIMESTAMP. It is called on update.

We also need to use statement based reproduction for the cluster.

Is there a way to modify the trigger so that the propagated CURRENT_TIMESTAMP is identical on every cluster instance?

Currently the statement based reproduction calls the statement for every cluster instance, resulting in slightly different timestamps.

Damien_The_Unbeliever
  • 220,246
  • 21
  • 302
  • 402
Urr4
  • 421
  • 5
  • 17
  • 2
    Which [DBMS product](https://en.wikipedia.org/wiki/DBMS) are you using? "SQL" is just a query language, not the name of a specific database product and database triggers are **highly** vendor specific. Please add a tag for the database product you are using `postgresql`, `oracle`, `sql-server`, `db2`, ... – a_horse_with_no_name May 07 '18 at 14:05
  • Perhaps ? – jarlh May 07 '18 at 14:09
  • We use a Mysql Database. I thought since a trigger is implemented by all sql dbs, this information would be enough, sorry. – Urr4 May 08 '18 at 09:45

1 Answers1

1

You must switch to mixed binlog format to save inside the binlog not only the statement but also the data for non deterministic writes.

You can do that without service disruption with:

SET GLOBAL binlog_format = 'MIXED';

On the master server generating the binlog.

Antonio Bardazzi
  • 2,620
  • 1
  • 16
  • 19