Should the checksum table created with IF NOT EXISTS

6 views
Skip to first unread message

Alfie John

unread,
Dec 12, 2011, 8:08:39 PM12/12/11
to Percona Dev
Let's say that the master where pt-table-checksum is run from is
failed over to a cold standby. This new master has all my data but pt-
table-checksum has never been run on it, so it doesn't have the
percona schema.

In pt-table-checksum's check_repl_table():

if ( !$tbl_exists ) {
if( $o->get('create-replicate-table') ) {
create_repl_table(%args)
}
else {
die "--replicate table $repl_table does not exist..."
}
}

So what will happen here is that the following will be run:

CREATE TABLE checksum (
...
)

However all my slaves already have the percona schema... it was only
the cold master which had it missing. So now replication fails since
we have:

"Table 'checksums' already exists"

To play it safe should the query be changed to:

CREATE TABLE IF NOT EXISTS checksum (
...
)

Alfie

Reply all
Reply to author
Forward
0 new messages