April 16, 2014

How to know if you’re updating Slave you should not ?

When replication runs out of sync first question you often ask is if someone could be writing to the slave. Of course there is read_only setting which is good to set in the slave but it is not set always and also users with SUPER privilege bypass it. Looking into binary log is obvious choice […]

Mirrored Binlogs patch

Google patches V1 contain interesting patch to mirror binary log on slave. Although Google is preparing GlobalTransactionId patch, which going to be replacement for MirroredBinlogs, we still think mirroring binary logs is very useful for: Backup of binary logs in real time High availability, to switch master load to slave with mirrored binary logs By […]

Why audit logging with triggers in MySQL is bad for replication

Recently I was tasked with investigating slippage between master and slave in a standard replication setup. The client was using Maatkit’s mk-table-checksum to check his slave data was indeed a fair copy of that of the master.

Troubleshooting Relay Log Corruption in MySQL

Have you ever seen the replication stopped with message like this: Last_Error: Could not parse relay log event entry. The possible reasons are: the master’s binary log is corrupted (you can check this by running ‘mysqlbinlog’ on the binary log), the slave’s relay log is corrupted (you can check this by running ‘mysqlbinlog’ on the […]


As you probably know MySQL Replication (statement based) works by fetching statements from MASTERs binary log and executing them on the SLAVE. Since MySQL 4.0 this process is a bit more involved having events passing via relay logs on the Slave which also means there are two replication threads “IO Thread” and “SQL Thread” used […]

Can MySQL temporary tables be made safe for statement-based replication?

A while ago I wrote about how to make MySQL replication reliable, part of which is to eliminate temporary tables. The idea is this: if a slave is stopped (or crashed) while a temporary table is open and is then restarted, the temporary table doesn’t exist anymore, and the slave will have problems trying to […]

No more MySQL Crash Safe Replication in 5.0 ?

As you might know even if you’re only using Innodb tables your replication is not completely crash safe – if Slave MySQL Server crashes/power goes down it is likely for relay logs to run out of sync (they are not synced to the disk) plus position on the master which slave remembers becomes stale. During […]

Filtered MySQL Replication

To get this straight – I’m not a big fan of filtered or partial MySQL Replication (as of version MySQL 5.0) – there is enough gotchas with replication itself and getting things right with filtering can get quite bumpy road. In some applications however it is very helpful so lets see what one should do […]

Figuring out what limits MySQL Replication

Today I was cloning the master using LVM Snapshot and found it was taking quite a while to catch up, which highlighted replication could be the limiting factor for this system quite soon, so I decided to check what is limiting MySQL Replication speed. My first idea was to check it based on slow query […]

MySQL Crash Recovery

MySQL is known for its stability but as any other application it has bugs so it may crash sometime. Also operation system may be flawed, hardware has problems or simply power can go down which all mean similar things – MySQL Shutdown is unexpected and there could be various inconsistences. And this is not only […]