Friday, June 27, 2008

Table checksums, row-based replication and Maatkit

Maatkit almost makes me want to use Perl. But this post is about table checksums, not Perl. Statement based replication it possible to build simple and efficient tools for computing table checksums on MySQL deployments with many slaves. Maatkit does just that with mk-table-checksum. MONyog might do it as well.

This works because the same SQL statement is run on the master and all of the slaves using the same view of the data. There is no need to stop replication on the slaves at the right point in time. However, this only works when statement based replication is used. Row based replication won't fix all problems that lead to inconsistent data. And even if you think it will, your diligence requires you to check to confirm your assumption.

Falcon doesn't support statement based replication.

1 comment:

  1. This post was really timely! I spent a couple hours last weekend dissecting Maatkit to figure out how Baron cleverly got replicated consistency checks to work. It's the statement replication that does the trick.

    As you know we are putting together open source replication at Continuent. We are probably going to add a statement replication "wormhole" to allow tools like Maatkit to function even in databases that only support row replication. It would work essentially through a magic table.

    ReplyDelete

 
Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.