pt-table-checksum should always create schema and tables with IF NOT EXISTS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Brian Fraser |
Bug Description
When pt-table-checksum is run on a master which already has the percona schema, the following won't be run:
- CREATE DATABASE percona
- CREATE TABLE dsns
- CREATE TABLE checksums
However if a slave doesn't have the schema, replication will break with "Table 'percona.checksums' doesn't exist".
If by default the schema is always created when checksumming, then we guarantee that the schema will be everywhere and replication is happy.
Note that this will need to happen along with (https:/
On a further note, Baron mentioned that some people might not want to, or not even be able to create the schema given restricted privileges. I don't think this is an issue seeing as --nocreate-
Related branches
- Daniel Nichter: Approve
-
Diff: 242 lines (+143/-18) (has conflicts)2 files modifiedbin/pt-table-checksum (+63/-15)
t/pt-table-checksum/privs.t (+80/-3)
Changed in percona-toolkit: | |
milestone: | none → 2.1.3 |
Changed in percona-toolkit: | |
assignee: | nobody → Brian Fraser (fraserbn) |
Changed in percona-toolkit: | |
status: | Confirmed → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Confirmed. In check_repl_table():
# If the repl db doesn't exit, auto-create it, maybe. unquote( $repl_table) ; 'create- replicate- table') ) {
create_ repl_table( %args)
my ($db, $tbl) = $q->split_
my $sql = "SHOW DATABASES LIKE '$db'";
...
if ( !$tbl_exists ) {
if ( $o->get(
}