Creating the percona schema in pt-table-checksum

16 views
Skip to first unread message

Alfie John

unread,
Feb 29, 2012, 4:36:56 PM2/29/12
to perco...@googlegroups.com
Hi guys,

I recently brought up a master from backups which didn't have the percona schema. I ran pt-table-checksum on this host, but replication stopped from this host to everywhere. pt-table-checksum looked at the new master and saw that the percona schema didn't exist so it created it. However, all slaves did have the percona schema causing replication to fail on "Can't create database 'percona'; database exists". Should all "CREATE DATABASE" and "CREATE TABLE" queries be qualified with "IF NOT EXISTS"? 

In another situation, I brought up a slave from backups. Again since the backups only had our schema in it, the percona schema was missing. pt-table-checksum was run from another machine which caused replication to stop on the new slave, failing on "Table 'percona.checksums' doesn't exist". Should --create-replicate-table be removed and then *always* create the percona schema when running pt-table-checksum so as to make sure the schema is on all slaves? As long as the "CREATE DATABASE" and "CREATE TABLE" queries are qualified with "IF NOT EXISTS", I don't see a problem in having a couple of bytes for overhead (just to make sure).

Alfie
Reply all
Reply to author
Forward
0 new messages