pt-table-checksum v2 fails when --resume + --ignore-database is used

Reported by Dave Juntgen on 2012-01-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit
Medium
Brian Fraser
2.0
Undecided
Unassigned
2.1
Medium
Brian Fraser

Bug Description

[ .... ]$ PTDEBUG=1 ./pt-table-checksum --resume --replicate=mie.table_checksum --user=djuntgen --ask-pass --ignore-databases=test,wc_process_monitor,information_schema,mie,rxdb_v1,rxdb_utf8 wc-c1-dbmaster.med-web.com
# /usr/bin/perl 5.010000
# Linux zeus.med-web.com 2.6.39.4-2.fc12.x86_64 #1 SMP Sat Sep 10 13:07:15 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
# Arguments: _[--resume]_ _[--replicate=mie.table_checksum]_ _[--user=xxxxx]_ _[--ask-pass]_ _[--ignore-databases=test,wc_process_monitor,information_schema,mie,rxdb_v1,rxdb_utf8]_ _[wc-c1-dbmaster.med-web.com]_
# OptionParser:548 27739 Option rule: This tool accepts additional command-line arguments. Refer to the SYNOPSIS and usage information for details.
# OptionParser:557 27739 =item --ask-pass
# OptionParser:584 27739 Short help: Prompt for a password when connecting to MySQL
# OptionParser:557 27739 =item --check-interval
# OptionParser:584 27739 Short help: Sleep time between checks for --max-lag
# OptionParser:557 27739 =item --[no]check-replication-filters
# OptionParser:584 27739 Short help: Do not checksum if any replication filters are set on any replicas
# OptionParser:557 27739 =item --check-slave-lag
# OptionParser:584 27739 Short help: Pause checksumming until this replica's lag is less than --max-lag
# OptionParser:557 27739 =item --chunk-index
# OptionParser:584 27739 Short help: Prefer this index for chunking tables
# OptionParser:557 27739 =item --chunk-size
# OptionParser:584 27739 Short help: Number of rows to select for each checksum query
# OptionParser:557 27739 =item --chunk-size-limit
# OptionParser:584 27739 Short help: Do not checksum chunks this much larger than the desired chunk size
# OptionParser:557 27739 =item --chunk-time
# OptionParser:584 27739 Short help: Adjust the chunk size dynamically so each checksum query takes this long to execute
# OptionParser:557 27739 =item --columns
# OptionParser:584 27739 Short help: Checksum only this comma-separated list of columns
# OptionParser:557 27739 =item --config
# OptionParser:584 27739 Short help: Read this comma-separated list of config files; if specified, this must be the first option on the command line
# OptionParser:557 27739 =item --[no]create-replicate-table
# OptionParser:584 27739 Short help: Create the --replicate database and table if they do not exist
# OptionParser:557 27739 =item --databases
# OptionParser:584 27739 Short help: Only checksum this comma-separated list of databases
# OptionParser:557 27739 =item --databases-regex
# OptionParser:584 27739 Short help: Only checksum databases whose names match this Perl regex
# OptionParser:557 27739 =item --defaults-file
# OptionParser:584 27739 Short help: Only read mysql options from the given file
# OptionParser:557 27739 =item --[no]empty-replicate-table
# OptionParser:584 27739 Short help: Delete previous checksums for each table before checksumming the table
# OptionParser:557 27739 =item --engines
# OptionParser:584 27739 Short help: Only checksum tables which use these storage engines
# OptionParser:557 27739 =item --explain
# OptionParser:584 27739 Short help: Show, but do not execute, checksum queries (disables --[no]empty-replicate-table)
# OptionParser:557 27739 =item --float-precision
# OptionParser:584 27739 Short help: Precision for FLOAT and DOUBLE number-to-string conversion
# OptionParser:557 27739 =item --function
# OptionParser:584 27739 Short help: Hash function for checksums (FNV1A_64, MURMUR_HASH, SHA1, MD5, CRC32, etc)
# OptionParser:557 27739 =item --help
# OptionParser:584 27739 Short help: Show help and exit
# OptionParser:557 27739 =item --host
# OptionParser:584 27739 Short help: Host to connect to
# OptionParser:557 27739 =item --ignore-columns
# OptionParser:584 27739 Short help: Ignore this comma-separated list of columns when calculating the checksum
# OptionParser:557 27739 =item --ignore-databases
# OptionParser:584 27739 Short help: Ignore this comma-separated list of databases
# OptionParser:557 27739 =item --ignore-databases-regex
# OptionParser:584 27739 Short help: Ignore databases whose names match this Perl regex
# OptionParser:557 27739 =item --ignore-engines
# OptionParser:584 27739 Short help: Ignore this comma-separated list of storage engines
# OptionParser:557 27739 =item --ignore-tables
# OptionParser:584 27739 Short help: Ignore this comma-separated list of tables
# OptionParser:557 27739 =item --ignore-tables-regex
# OptionParser:584 27739 Short help: Ignore tables whose names match the Perl regex
# OptionParser:557 27739 =item --lock-wait-timeout
# OptionParser:584 27739 Short help: Set the session value of the innodb_lock_wait_timeout variable on the master host
# OptionParser:557 27739 =item --max-lag
# OptionParser:584 27739 Short help: Pause checksumming until all replicas' lag is less than this value
# OptionParser:557 27739 =item --max-load
# OptionParser:584 27739 Short help: Examine SHOW GLOBAL STATUS after every chunk, and pause if any status variables are higher than the threshold
# OptionParser:557 27739 =item --password
# OptionParser:584 27739 Short help: Password to use when connecting
# OptionParser:557 27739 =item --pid
# OptionParser:584 27739 Short help: Create the given PID file
# OptionParser:557 27739 =item --port
# OptionParser:584 27739 Short help: Port number to use for connection
# OptionParser:557 27739 =item --progress
# OptionParser:584 27739 Short help: Print progress reports to STDERR
# OptionParser:557 27739 =item --quiet
# OptionParser:584 27739 Short help: Print only the most important information (disables --progress)
# OptionParser:557 27739 =item --recurse
# OptionParser:584 27739 Short help: Number of levels to recurse in the hierarchy when discovering replicas
# OptionParser:557 27739 =item --recursion-method
# OptionParser:584 27739 Short help: Preferred recursion method for discovering replicas
# OptionParser:557 27739 =item --replicate
# OptionParser:584 27739 Short help: Write checksum results to this table
# OptionParser:557 27739 =item --[no]replicate-check
# OptionParser:584 27739 Short help: Check replicas for data differences after finishing each table
# OptionParser:557 27739 =item --replicate-check-only
# OptionParser:576 27739 Option has no attributes
# OptionParser:584 27739 Short help: Check replicas for consistency without executing checksum queries
# OptionParser:557 27739 =item --replicate-database
# OptionParser:584 27739 Short help: USE only this database
# OptionParser:557 27739 =item --resume
# OptionParser:576 27739 Option has no attributes
# OptionParser:584 27739 Short help: Resume checksumming from the last completed chunk (disables --[no]empty-replicate-table)
# OptionParser:557 27739 =item --retries
# OptionParser:584 27739 Short help: Retry a chunk this many times when there is a nonfatal error
# OptionParser:557 27739 =item --separator
# OptionParser:584 27739 Short help: The separator character used for CONCAT_WS()
# OptionParser:557 27739 =item --set-vars
# OptionParser:584 27739 Short help: Set these MySQL variables
# OptionParser:557 27739 =item --socket
# OptionParser:584 27739 Short help: Socket file to use for connection
# OptionParser:557 27739 =item --tables
# OptionParser:584 27739 Short help: Checksum only this comma-separated list of tables
# OptionParser:557 27739 =item --tables-regex
# OptionParser:584 27739 Short help: Checksum only tables whose names match this Perl regex
# OptionParser:557 27739 =item --trim
# OptionParser:576 27739 Option has no attributes
# OptionParser:584 27739 Short help: Add TRIM() to VARCHAR columns (helps when comparing 4.1 to >= 5.0)
# OptionParser:557 27739 =item --user
# OptionParser:584 27739 Short help: User for login if not current user
# OptionParser:557 27739 =item --version
# OptionParser:584 27739 Short help: Show version and exit
# OptionParser:557 27739 =item --where
# OptionParser:584 27739 Short help: Do only rows matching this WHERE clause
# OptionParser:623 27739 Parsing opt spec: group => Connection spec => ask-pass desc => Prompt for a password when connecting to MySQL
# OptionParser:661 27739 ask-pass type: undef
# OptionParser:623 27739 Parsing opt spec: group => Throttle spec => check-interval=m desc => Sleep time between checks for --max-lag (default 1)
# OptionParser:661 27739 check-interval type: m
# OptionParser:668 27739 check-interval default: 1
# OptionParser:623 27739 Parsing opt spec: group => Safety spec => check-replication-filters! desc => Do not checksum if any replication filters are set on any replicas (default yes)
# OptionParser:661 27739 check-replication-filters type: undef
# OptionParser:668 27739 check-replication-filters default: yes
# OptionParser:623 27739 Parsing opt spec: group => Throttle spec => check-slave-lag=s desc => Pause checksumming until this replica's lag is less than --max-lag
# OptionParser:661 27739 check-slave-lag type: s
# OptionParser:623 27739 Parsing opt spec: group => default spec => chunk-index=s desc => Prefer this index for chunking tables
# OptionParser:661 27739 chunk-index type: s
# OptionParser:623 27739 Parsing opt spec: group => default spec => chunk-size=z desc => Number of rows to select for each checksum query (default 1000)
# OptionParser:661 27739 chunk-size type: z
# OptionParser:668 27739 chunk-size default: 1000
# OptionParser:623 27739 Parsing opt spec: group => Safety spec => chunk-size-limit=f desc => Do not checksum chunks this much larger than the desired chunk size (default 2.0)
# OptionParser:661 27739 chunk-size-limit type: f
# OptionParser:668 27739 chunk-size-limit default: 2.0
# OptionParser:623 27739 Parsing opt spec: group => default spec => chunk-time=f desc => Adjust the chunk size dynamically so each checksum query takes this long to execute (default 0.5)
# OptionParser:661 27739 chunk-time type: f
# OptionParser:668 27739 chunk-time default: 0.5
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => columns|c=a desc => Checksum only this comma-separated list of columns
# OptionParser:661 27739 columns type: a
# OptionParser:623 27739 Parsing opt spec: group => Config spec => config=A desc => Read this comma-separated list of config files; if specified, this must be the first option on the command line
# OptionParser:661 27739 config type: A
# OptionParser:623 27739 Parsing opt spec: group => default spec => create-replicate-table! desc => Create the --replicate database and table if they do not exist (default yes)
# OptionParser:661 27739 create-replicate-table type: undef
# OptionParser:668 27739 create-replicate-table default: yes
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => databases|d=h desc => Only checksum this comma-separated list of databases
# OptionParser:661 27739 databases type: h
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => databases-regex=s desc => Only checksum databases whose names match this Perl regex
# OptionParser:661 27739 databases-regex type: s
# OptionParser:623 27739 Parsing opt spec: group => Connection spec => defaults-file|F=s desc => Only read mysql options from the given file
# OptionParser:661 27739 defaults-file type: s
# OptionParser:623 27739 Parsing opt spec: group => default spec => empty-replicate-table! desc => Delete previous checksums for each table before checksumming the table (default yes)
# OptionParser:661 27739 empty-replicate-table type: undef
# OptionParser:668 27739 empty-replicate-table default: yes
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => engines|e=h desc => Only checksum tables which use these storage engines
# OptionParser:661 27739 engines type: h
# OptionParser:623 27739 Parsing opt spec: group => Output spec => explain+ desc => Show, but do not execute, checksum queries (disables --[no]empty-replicate-table) (default 0)
# OptionParser:661 27739 explain type: undef
# OptionParser:668 27739 explain default: 0
# OptionParser:677 27739 Deferring check of disables rule for HASH(0x12bf748) disables --[no]empty-replicate-table) (default 0)
# OptionParser:623 27739 Parsing opt spec: group => default spec => float-precision=i desc => Precision for FLOAT and DOUBLE number-to-string conversion
# OptionParser:661 27739 float-precision type: i
# OptionParser:623 27739 Parsing opt spec: group => default spec => function=s desc => Hash function for checksums (FNV1A_64, MURMUR_HASH, SHA1, MD5, CRC32, etc)
# OptionParser:661 27739 function type: s
# OptionParser:623 27739 Parsing opt spec: group => Help spec => help desc => Show help and exit
# OptionParser:661 27739 help type: undef
# OptionParser:623 27739 Parsing opt spec: group => Connection spec => host|h=s desc => Host to connect to (default localhost)
# OptionParser:661 27739 host type: s
# OptionParser:668 27739 host default: localhost
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => ignore-columns=H desc => Ignore this comma-separated list of columns when calculating the checksum
# OptionParser:661 27739 ignore-columns type: H
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => ignore-databases=H desc => Ignore this comma-separated list of databases
# OptionParser:661 27739 ignore-databases type: H
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => ignore-databases-regex=s desc => Ignore databases whose names match this Perl regex
# OptionParser:661 27739 ignore-databases-regex type: s
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => ignore-engines=H desc => Ignore this comma-separated list of storage engines (default FEDERATED,MRG_MyISAM)
# OptionParser:661 27739 ignore-engines type: H
# OptionParser:668 27739 ignore-engines default: FEDERATED,MRG_MyISAM
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => ignore-tables=H desc => Ignore this comma-separated list of tables
# OptionParser:661 27739 ignore-tables type: H
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => ignore-tables-regex=s desc => Ignore tables whose names match the Perl regex
# OptionParser:661 27739 ignore-tables-regex type: s
# OptionParser:623 27739 Parsing opt spec: group => default spec => lock-wait-timeout=i desc => Set the session value of the innodb_lock_wait_timeout variable on the master host (default 1)
# OptionParser:661 27739 lock-wait-timeout type: i
# OptionParser:668 27739 lock-wait-timeout default: 1
# OptionParser:623 27739 Parsing opt spec: group => Throttle spec => max-lag=m desc => Pause checksumming until all replicas' lag is less than this value (default 1s)
# OptionParser:661 27739 max-lag type: m
# OptionParser:668 27739 max-lag default: 1s
# OptionParser:623 27739 Parsing opt spec: group => Throttle spec => max-load=A desc => Examine SHOW GLOBAL STATUS after every chunk, and pause if any status variables are higher than the threshold (default Threads_running=25)
# OptionParser:661 27739 max-load type: A
# OptionParser:668 27739 max-load default: Threads_running=25
# OptionParser:623 27739 Parsing opt spec: group => Connection spec => password|p=s desc => Password to use when connecting
# OptionParser:661 27739 password type: s
# OptionParser:623 27739 Parsing opt spec: group => default spec => pid=s desc => Create the given PID file
# OptionParser:661 27739 pid type: s
# OptionParser:623 27739 Parsing opt spec: group => Connection spec => port|P=i desc => Port number to use for connection
# OptionParser:661 27739 port type: i
# OptionParser:623 27739 Parsing opt spec: group => default spec => progress=a desc => Print progress reports to STDERR (default time,30)
# OptionParser:661 27739 progress type: a
# OptionParser:668 27739 progress default: time,30
# OptionParser:623 27739 Parsing opt spec: group => default spec => quiet|q+ desc => Print only the most important information (disables --progress) (default 0)
# OptionParser:661 27739 quiet type: undef
# OptionParser:668 27739 quiet default: 0
# OptionParser:677 27739 Deferring check of disables rule for HASH(0x12bef08) disables --progress) (default 0)
# OptionParser:623 27739 Parsing opt spec: group => default spec => recurse=i desc => Number of levels to recurse in the hierarchy when discovering replicas
# OptionParser:661 27739 recurse type: i
# OptionParser:623 27739 Parsing opt spec: group => default spec => recursion-method=s desc => Preferred recursion method for discovering replicas
# OptionParser:661 27739 recursion-method type: s
# OptionParser:623 27739 Parsing opt spec: group => default spec => replicate=s desc => Write checksum results to this table (default percona.checksums)
# OptionParser:661 27739 replicate type: s
# OptionParser:668 27739 replicate default: percona.checksums
# OptionParser:623 27739 Parsing opt spec: group => default spec => replicate-check! desc => Check replicas for data differences after finishing each table (default yes)
# OptionParser:661 27739 replicate-check type: undef
# OptionParser:668 27739 replicate-check default: yes
# OptionParser:623 27739 Parsing opt spec: group => default spec => replicate-check-only desc => Check replicas for consistency without executing checksum queries
# OptionParser:661 27739 replicate-check-only type: undef
# OptionParser:623 27739 Parsing opt spec: group => default spec => replicate-database=s desc => USE only this database
# OptionParser:661 27739 replicate-database type: s
# OptionParser:623 27739 Parsing opt spec: group => default spec => resume desc => Resume checksumming from the last completed chunk (disables --[no]empty-replicate-table)
# OptionParser:661 27739 resume type: undef
# OptionParser:677 27739 Deferring check of disables rule for HASH(0x12beb18) disables --[no]empty-replicate-table)
# OptionParser:623 27739 Parsing opt spec: group => default spec => retries=i desc => Retry a chunk this many times when there is a nonfatal error (default 2)
# OptionParser:661 27739 retries type: i
# OptionParser:668 27739 retries default: 2
# OptionParser:623 27739 Parsing opt spec: group => default spec => separator=s desc => The separator character used for CONCAT_WS() (default #)
# OptionParser:661 27739 separator type: s
# OptionParser:668 27739 separator default: #
# OptionParser:623 27739 Parsing opt spec: group => Connection spec => set-vars=s desc => Set these MySQL variables (default wait_timeout=10000)
# OptionParser:661 27739 set-vars type: s
# OptionParser:668 27739 set-vars default: wait_timeout=10000
# OptionParser:623 27739 Parsing opt spec: group => Connection spec => socket|S=s desc => Socket file to use for connection
# OptionParser:661 27739 socket type: s
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => tables|t=h desc => Checksum only this comma-separated list of tables
# OptionParser:661 27739 tables type: h
# OptionParser:623 27739 Parsing opt spec: group => Filter spec => tables-regex=s desc => Checksum only tables whose names match this Perl regex
# OptionParser:661 27739 tables-regex type: s
# OptionParser:623 27739 Parsing opt spec: group => default spec => trim desc => Add TRIM() to VARCHAR columns (helps when comparing 4.1 to >= 5.0)
# OptionParser:661 27739 trim type: undef
# OptionParser:623 27739 Parsing opt spec: group => Connection spec => user|u=s desc => User for login if not current user
# OptionParser:661 27739 user type: s
# OptionParser:623 27739 Parsing opt spec: group => Help spec => version desc => Show version and exit
# OptionParser:661 27739 version type: undef
# OptionParser:623 27739 Parsing opt spec: group => default spec => where=s desc => Do only rows matching this WHERE clause
# OptionParser:661 27739 where type: s
# OptionParser:683 27739 Parsing rule: This tool accepts additional command-line arguments. Refer to the SYNOPSIS and usage information for details.
# OptionParser:739 27739 Participants for This tool accepts additional command-line arguments. Refer to the SYNOPSIS and usage information for details. :
# OptionParser:715 27739 Strict mode disabled by rule
# OptionParser:739 27739 Participants for disables --[no]empty-replicate-table) : empty-replicate-table
# OptionParser:725 27739 Option resume disables empty-replicate-table
# OptionParser:739 27739 Participants for disables --progress) (default 0) : progress
# OptionParser:725 27739 Option quiet disables progress
# OptionParser:739 27739 Participants for disables --[no]empty-replicate-table) (default 0) : empty-replicate-table
# OptionParser:725 27739 Option explain disables empty-replicate-table
# OptionParser:467 27739 Parsing DSN OPTIONS
# OptionParser:557 27739 =item * A
# OptionParser:584 27739 Short help: Default character set
# OptionParser:557 27739 =item * D
# OptionParser:584 27739 Short help: DSN table database
# OptionParser:557 27739 =item * F
# OptionParser:584 27739 Short help: Only read default options from the given file
# OptionParser:557 27739 =item * h
# OptionParser:584 27739 Short help: Connect to host
# OptionParser:557 27739 =item * p
# OptionParser:584 27739 Short help: Password to use when connecting
# OptionParser:557 27739 =item * P
# OptionParser:584 27739 Short help: Port number to use for connection
# OptionParser:557 27739 =item * S
# OptionParser:584 27739 Short help: Socket file to use for connection
# OptionParser:557 27739 =item * t
# OptionParser:584 27739 Short help: DSN table table
# OptionParser:557 27739 =item * u
# OptionParser:584 27739 Short help: User for login if not current user
# DSNParser:50 27739 DSN option: copy=1, dsn=charset, desc=Default character set, key=A
# DSNParser:50 27739 DSN option: copy=, dsn=undef, desc=DSN table database, key=D
# DSNParser:50 27739 DSN option: copy=, dsn=mysql_read_default_file, desc=Only read default options from the given file, key=F
# DSNParser:50 27739 DSN option: copy=1, dsn=host, desc=Connect to host, key=h
# DSNParser:50 27739 DSN option: copy=1, dsn=password, desc=Password to use when connecting, key=p
# DSNParser:50 27739 DSN option: copy=1, dsn=port, desc=Port number to use for connection, key=P
# DSNParser:50 27739 DSN option: copy=, dsn=mysql_socket, desc=Socket file to use for connection, key=S
# DSNParser:50 27739 DSN option: copy=, dsn=undef, desc=DSN table table, key=t
# DSNParser:50 27739 DSN option: copy=1, dsn=user, desc=User for login if not current user, key=u
# OptionParser:511 27739 pt-table-checksum 2.0.1
# OptionParser:823 27739 Cannot open /etc/percona-toolkit/percona-toolkit.conf: No such file or directory
#
# OptionParser:823 27739 Cannot open /etc/percona-toolkit/pt-table-checksum.conf: No such file or directory
#
# OptionParser:823 27739 Cannot open /home/djuntgen/.percona-toolkit.conf: No such file or directory
#
# OptionParser:823 27739 Cannot open /home/djuntgen/.pt-table-checksum.conf: No such file or directory
#
# OptionParser:791 27739 Got option resume = 1
# OptionParser:791 27739 Got option replicate = mie.table_checksum
# OptionParser:791 27739 Got option user = djuntgen
# OptionParser:791 27739 Got option ask-pass = 1
# OptionParser:791 27739 Got option ignore-databases = test,wc_process_monitor,information_schema,mie,rxdb_v1,rxdb_utf8
# OptionParser:1011 27739 Nothing to validate for option ignore-tables-regex type s value undef
# OptionParser:1001 27739 Parsing option chunk-size as a size value
# OptionParser:1011 27739 Nothing to validate for option recursion-method type s value undef
# OptionParser:1011 27739 Nothing to validate for option ignore-databases-regex type s value undef
# OptionParser:1011 27739 Nothing to validate for option check-slave-lag type s value undef
# OptionParser:1011 27739 Nothing to validate for option chunk-index type s value undef
# OptionParser:1011 27739 Nothing to validate for option tables type h value undef
# OptionParser:1011 27739 Nothing to validate for option password type s value undef
# OptionParser:1011 27739 Nothing to validate for option pid type s value undef
# OptionParser:1011 27739 Nothing to validate for option replicate type s value mie.table_checksum
# OptionParser:1011 27739 Nothing to validate for option float-precision type i value undef
# OptionParser:1011 27739 Nothing to validate for option user type s value djuntgen
# OptionParser:1011 27739 Nothing to validate for option chunk-time type f value 0.5
# OptionParser:1011 27739 Nothing to validate for option set-vars type s value wait_timeout=10000
# OptionParser:1011 27739 Nothing to validate for option port type i value undef
# OptionParser:1011 27739 Nothing to validate for option socket type s value undef
# OptionParser:1011 27739 Nothing to validate for option lock-wait-timeout type i value 1
# OptionParser:962 27739 Parsing option check-interval as a time value
# OptionParser:967 27739 No suffix given; using s for check-interval (value: 1 )
# OptionParser:976 27739 Setting option check-interval to 1
# OptionParser:1011 27739 Nothing to validate for option recurse type i value undef
# OptionParser:1011 27739 Nothing to validate for option columns type a value undef
# OptionParser:962 27739 Parsing option max-lag as a time value
# OptionParser:976 27739 Setting option max-lag to 1
# OptionParser:1011 27739 Nothing to validate for option replicate-database type s value undef
# OptionParser:1011 27739 Nothing to validate for option engines type h value undef
# OptionParser:1011 27739 Nothing to validate for option retries type i value 2
# OptionParser:1011 27739 Nothing to validate for option function type s value undef
# OptionParser:1011 27739 Nothing to validate for option databases-regex type s value undef
# OptionParser:889 27739 Unset options empty-replicate-table because resume disables them
# OptionParser:1011 27739 Nothing to validate for option tables-regex type s value undef
# OptionParser:1011 27739 Nothing to validate for option chunk-size-limit type f value 2.0
# OptionParser:1011 27739 Nothing to validate for option databases type h value undef
# OptionParser:1011 27739 Nothing to validate for option where type s value undef
# OptionParser:1011 27739 Nothing to validate for option defaults-file type s value undef
# OptionParser:1011 27739 Nothing to validate for option host type s value localhost
# OptionParser:1011 27739 Nothing to validate for option separator type s value #
# DSNParser:66 27739 Setting set-vars property
# OptionParser:1085 27739 Getting description and usage from SYNOPSIS in ./pt-table-checksum
# OptionParser:1338 27739 Parsing SYNOPSIS in ./pt-table-checksum
# OptionParser:1351 27739 Raw SYNOPSIS text: Usage: pt-table-checksum [OPTION...] [DSN]
#
# pt-table-checksum performs an online replication consistency check by executing
# checksum queries on the master, which produces different results on replicas
# that are inconsistent with the master. The optional DSN specifies the master
# host. The tool's exit status is nonzero if any differences are found, or if any
# warnings or errors occur.
#
#
# OptionParser:1089 27739 Description: pt-table-checksum performs an online replication consistency check by executing checksum queries on the master, which produces different results on replicas that are inconsistent with the master. The optional DSN specifies the master host. The tool's exit status is nonzero if any differences are found, or if any warnings or errors occur.
# Usage: pt-table-checksum [OPTION...] [DSN]
# DSNParser:137 27739 DSN string made from options: u=djuntgen,h=localhost
# DSNParser:78 27739 Parsing u=djuntgen,h=localhost
# DSNParser:96 27739 Finding value for S
# DSNParser:106 27739 Copying value for S from defaults
# DSNParser:96 27739 Finding value for F
# DSNParser:106 27739 Copying value for F from defaults
# DSNParser:96 27739 Finding value for A
# DSNParser:106 27739 Copying value for A from defaults
# DSNParser:96 27739 Finding value for P
# DSNParser:106 27739 Copying value for P from defaults
# DSNParser:96 27739 Finding value for p
# DSNParser:106 27739 Copying value for p from defaults
# DSNParser:96 27739 Finding value for u
# DSNParser:96 27739 Finding value for h
# DSNParser:96 27739 Finding value for D
# DSNParser:106 27739 Copying value for D from defaults
# DSNParser:96 27739 Finding value for t
# DSNParser:106 27739 Copying value for t from defaults
# DSNParser:78 27739 Parsing wc-c1-dbmaster.med-web.com
# DSNParser:90 27739 Interpreting wc-c1-dbmaster.med-web.com as h= wc-c1-dbmaster.med-web.com
# DSNParser:96 27739 Finding value for S
# DSNParser:106 27739 Copying value for S from defaults
# DSNParser:96 27739 Finding value for F
# DSNParser:106 27739 Copying value for F from defaults
# DSNParser:96 27739 Finding value for A
# DSNParser:106 27739 Copying value for A from defaults
# DSNParser:96 27739 Finding value for P
# DSNParser:106 27739 Copying value for P from defaults
# DSNParser:96 27739 Finding value for p
# DSNParser:106 27739 Copying value for p from defaults
# DSNParser:96 27739 Finding value for u
# DSNParser:106 27739 Copying value for u from defaults
# DSNParser:96 27739 Finding value for h
# DSNParser:96 27739 Finding value for D
# DSNParser:106 27739 Copying value for D from defaults
# DSNParser:96 27739 Finding value for t
# DSNParser:106 27739 Copying value for t from defaults
Enter MySQL password:
# DSNParser:189 27739 DBI:mysql:;host=wc-c1-dbmaster.med-web.com;mysql_read_default_group=client
# DSNParser:235 27739 DBI:mysql:;host=wc-c1-dbmaster.med-web.com;mysql_read_default_group=client djuntgen xxxxx
 mysql_enable_utf8=>0, ShowErrorStatement=>1, AutoCommit=>1, RaiseError=>1, PrintError=>0
# DSNParser:244 27739 DBI::db=HASH(0x1440288) SELECT @@SQL_MODE
# DSNParser:251 27739 DBI::db=HASH(0x1440288) SET @@SQL_QUOTE_SHOW_CREATE = 1/*!40101, @@SQL_MODE='NO_AUTO_VALUE_ON_ZERO'*/
# DSNParser:270 27739 DBI::db=HASH(0x1440288) : SET wait_timeout=10000
# DSNParser:296 27739 DBH info: DBI::db=HASH(0x1440288) $VAR1 = {
# '@@hostname' => 'wc-c1-db2.med-web.com',
# 'CONNECTION_ID()' => '2054634',
# 'DATABASE()' => undef,
# 'VERSION()' => '5.1.56-rel12.7-log'
# };
# Connection info: wc-c1-dbmaster.med-web.com via TCP/IP Character set info: $VAR1 = [
# {
# Value => 'latin1',
# Variable_name => 'character_set_client'
# },
# {
# Value => 'latin1',
# Variable_name => 'character_set_connection'
# },
# {
# Value => 'latin1',
# Variable_name => 'character_set_database'
# },
# {
# Value => 'binary',
# Variable_name => 'character_set_filesystem'
# },
# {
# Value => 'latin1',
# Variable_name => 'character_set_results'
# },
# {
# Value => 'latin1',
# Variable_name => 'character_set_server'
# },
# {
# Value => 'utf8',
# Variable_name => 'character_set_system'
# },
# {
# Value => '/usr/local/mysql-percona-5.1.56.x86_64/share/mysql/charsets/',
# Variable_name => 'character_sets_dir'
# }
# ];
# $DBD::mysql::VERSION: 4.013 $DBI::VERSION: 1.609
# Cxn:1461 27739 DBI::db=HASH(0x1440288) Connected dbh to undef
# Cxn:1474 27739 DBI::db=HASH(0x1440288) Setting dbh
# Cxn:1479 27739 DBI::db=HASH(0x1440288) SELECT @@hostname, @@server_id
# Cxn:1481 27739 DBI::db=HASH(0x1440288) hostname: wc-c1-db2.med-web.com 1
# pt_table_checksum:5886 27739 DBI::db=HASH(0x1440288) /*!50108 SET @@binlog_format := "STATEMENT"*/
# pt_table_checksum:5900 27739 DBI::db=HASH(0x1440288) SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ
# pt_table_checksum:5918 27739 DBI::db=HASH(0x1440288) SHOW SESSION VARIABLES LIKE "innodb_lock_wait_timeout"
# pt_table_checksum:5920 27739 innodb_lock_wait_timeout 50
# pt_table_checksum:5924 27739 DBI::db=HASH(0x1440288) SET SESSION innodb_lock_wait_timeout=1
# MasterSlave:2456 27739 Slave recursion method: undef
# MasterSlave:2504 27739 Connected to h=wc-c1-dbmaster.med-web.com,p=...,u=djuntgen
# MasterSlave:2513 27739 SELECT @@SERVER_ID
# MasterSlave:2515 27739 Working on server ID 1
# MasterSlave:2559 27739 Looking for slaves on h=wc-c1-dbmaster.med-web.com,p=...,u=djuntgen using methods processlist hosts
# MasterSlave:2566 27739 Finding slaves with _find_slaves_by_processlist
# VersionParser:1677 27739 5.1.56-rel12.7-log parses to 005001056
# VersionParser:1677 27739 4.1.2 parses to 004001002
# VersionParser:1688 27739 005001056 ge 4.1.2 : 1
# MasterSlave:2633 27739 DBI::db=HASH(0x1440288) SHOW GRANTS FOR CURRENT_USER()
# MasterSlave:2663 27739 DBI::db=HASH(0x1440288) SHOW PROCESSLIST
# DSNParser:78 27739 Parsing h=192.168.85.9
# DSNParser:96 27739 Finding value for S
# DSNParser:106 27739 Copying value for S from defaults
# DSNParser:96 27739 Finding value for F
# DSNParser:106 27739 Copying value for F from defaults
# DSNParser:96 27739 Finding value for A
# DSNParser:106 27739 Copying value for A from defaults
# DSNParser:96 27739 Finding value for P
# DSNParser:106 27739 Copying value for P from defaults
# DSNParser:96 27739 Finding value for p
# DSNParser:102 27739 Copying value for p from previous DSN
# DSNParser:96 27739 Finding value for u
# DSNParser:102 27739 Copying value for u from previous DSN
# DSNParser:96 27739 Finding value for h
# DSNParser:96 27739 Finding value for D
# DSNParser:106 27739 Copying value for D from defaults
# DSNParser:96 27739 Finding value for t
# DSNParser:106 27739 Copying value for t from defaults
# MasterSlave:2571 27739 Found 1 slaves
# MasterSlave:2537 27739 Recursing from h=wc-c1-dbmaster.med-web.com,p=...,u=djuntgen to h=192.168.85.9,p=...,u=djuntgen
# DSNParser:189 27739 DBI:mysql:;host=192.168.85.9;mysql_read_default_group=client
# DSNParser:235 27739 DBI:mysql:;host=192.168.85.9;mysql_read_default_group=client djuntgen xxxx mysql_enable_utf8=>0, ShowErrorStatement=>1, AutoCommit=>1, RaiseError=>1, PrintError=>0
# DSNParser:244 27739 DBI::db=HASH(0x143df08) SELECT @@SQL_MODE
# DSNParser:251 27739 DBI::db=HASH(0x143df08) SET @@SQL_QUOTE_SHOW_CREATE = 1/*!40101, @@SQL_MODE='NO_AUTO_VALUE_ON_ZERO'*/
# DSNParser:270 27739 DBI::db=HASH(0x143df08) : SET wait_timeout=10000
# DSNParser:296 27739 DBH info: DBI::db=HASH(0x143df08) $VAR1 = {
# '@@hostname' => 'wcdb-slave2.med-web.com',
# 'CONNECTION_ID()' => '872736',
# 'DATABASE()' => undef,
# 'VERSION()' => '5.1.59rel13.0-log'
# };
# Connection info: 192.168.85.9 via TCP/IP Character set info: $VAR1 = [
# {
# Value => 'latin1',
# Variable_name => 'character_set_client'
# },
# {
# Value => 'latin1',
# Variable_name => 'character_set_connection'
# },
# {
# Value => 'latin1',
# Variable_name => 'character_set_database'
# },
# {
# Value => 'binary',
# Variable_name => 'character_set_filesystem'
# },
# {
# Value => 'latin1',
# Variable_name => 'character_set_results'
# },
# {
# Value => 'latin1',
# Variable_name => 'character_set_server'
# },
# {
# Value => 'utf8',
# Variable_name => 'character_set_system'
# },
# {
# Value => '/usr/local/mysql-percona-5.1.59.x86_64/share/mysql/charsets/',
# Variable_name => 'character_sets_dir'
# }
# ];
# $DBD::mysql::VERSION: 4.013 $DBI::VERSION: 1.609
# MasterSlave:2504 27739 Connected to h=192.168.85.9,p=...,u=djuntgen
# MasterSlave:2513 27739 SELECT @@SERVER_ID
# MasterSlave:2515 27739 Working on server ID 3
# MasterSlave:2472 27739 Found slave: h=192.168.85.9,p=...,u=djuntgen
# DSNParser:137 27739 DSN string made from options: u=djuntgen,h=localhost
# DSNParser:78 27739 Parsing u=djuntgen,h=localhost
# DSNParser:96 27739 Finding value for S
# DSNParser:106 27739 Copying value for S from defaults
# DSNParser:96 27739 Finding value for F
# DSNParser:106 27739 Copying value for F from defaults
# DSNParser:96 27739 Finding value for A
# DSNParser:106 27739 Copying value for A from defaults
# DSNParser:96 27739 Finding value for P
# DSNParser:106 27739 Copying value for P from defaults
# DSNParser:96 27739 Finding value for p
# DSNParser:106 27739 Copying value for p from defaults
# DSNParser:96 27739 Finding value for u
# DSNParser:96 27739 Finding value for h
# DSNParser:96 27739 Finding value for D
# DSNParser:106 27739 Copying value for D from defaults
# DSNParser:96 27739 Finding value for t
# DSNParser:106 27739 Copying value for t from defaults
# Cxn:1461 27739 DBI::db=HASH(0x143df08) Connected dbh to undef
# Cxn:1474 27739 DBI::db=HASH(0x143df08) Setting dbh
# Cxn:1479 27739 DBI::db=HASH(0x143df08) SELECT @@hostname, @@server_id
# Cxn:1481 27739 DBI::db=HASH(0x143df08) hostname: wcdb-slave2.med-web.com 3
# MasterSlave:2559 27739 Looking for slaves on h=192.168.85.9,p=...,u=djuntgen using methods processlist hosts
# MasterSlave:2566 27739 Finding slaves with _find_slaves_by_processlist
# VersionParser:1677 27739 5.1.59rel13.0-log parses to 005001059
# VersionParser:1677 27739 4.1.2 parses to 004001002
# VersionParser:1688 27739 005001059 ge 4.1.2 : 1
# MasterSlave:2633 27739 DBI::db=HASH(0x143df08) SHOW GRANTS FOR CURRENT_USER()
# MasterSlave:2663 27739 DBI::db=HASH(0x143df08) SHOW PROCESSLIST
# MasterSlave:2566 27739 Finding slaves with _find_slaves_by_hosts
# MasterSlave:2600 27739 DBI::db=HASH(0x143df08) SHOW SLAVE HOSTS
# MasterSlave:2571 27739 Found 0 slaves
# pt_table_checksum:6005 27739 1 slaves found
# pt_table_checksum:6016 27739 Will check slave lag on all slaves
# pt_table_checksum:6052 27739 Checking slave replication filters
# MasterSlave:2747 27739 DBI::db=HASH(0x143df08) SHOW MASTER STATUS
# MasterSlave:2751 27739 binlog_do_db= position=106 file=mysql-bin.000110 binlog_ignore_db=
# MasterSlave:2723 27739 DBI::db=HASH(0x143df08) SHOW SLAVE STATUS
# MasterSlave:3049 27739 DBI::db=HASH(0x143df08) SHOW VARIABLES LIKE 'slave_skip_errors'
# pt_table_checksum:6995 27739 Checking --replicate table `mie`.`table_checksum`
# pt_table_checksum:7000 27739 SHOW DATABASES LIKE 'mie'
# pt_table_checksum:7098 27739 use_repl_db
# pt_table_checksum:7119 27739 USE `mie`
# TableParser:1952 27739 Checking `mie`.`table_checksum`
# TableParser:1956 27739 SHOW TABLES FROM `mie` LIKE 'table\_checksum'
# TableParser:1970 27739 Table exists; no privs to check
# pt_table_checksum:7033 27739 --replicate table `mie`.`table_checksum` already exists
# TableParser:1952 27739 Checking `mie`.`table_checksum`
# TableParser:1956 27739 SHOW TABLES FROM `mie` LIKE 'table\_checksum'
# TableParser:1970 27739 Table exists; no privs to check
# TableParser:1974 27739 SHOW FULL COLUMNS FROM `mie`.`table_checksum`
# TableParser:1989 27739 DELETE FROM `mie`.`table_checksum` LIMIT 0
# TableParser:1995 27739 User privs on `mie`.`table_checksum` : select,insert,update,references delete
# TableParser:2004 27739 User has all privs
# MySQLStatusWaiter:5631 27739 Wait if Threads_running >= 25
# RowChecksum:3329 27739 SELECT CRC32('test-string')
# RowChecksum:3336 27739 Chosen hash func: undef
# RowChecksum:3376 27739 SELECT CRC32('a') bigint 10
# RowChecksum:3382 27739 crc_type: int length: 10
# pt_table_checksum:7201 27739 Getting last chunk for --resume
# pt_table_checksum:7206 27739 SELECT * FROM `mie`.`table_checksum` FORCE INDEX (ts_db_tbl) WHERE master_cnt IS NOT NULL ORDER BY ts DESC, db DESC, tbl DESC LIMIT 1
# pt_table_checksum:7211 27739 Last chunk: $VAR1 = {
# chunk => '2',
# chunk_index => 'PRIMARY',
# chunk_time => '0.222363',
# db => 'rxdb_utf8',
# lower_boundary => '1013979962',
# master_cnt => '822',
# master_crc => '5f44645',
# tbl => 'NPI_individuals',
# this_cnt => '822',
# this_crc => '5f44645',
# ts => '2012-01-03 12:41:39',
# upper_boundary => '1013989615'
# };
#
# SchemaIterator:4551 27739 Will resume from or after `rxdb_utf8`.`NPI_individuals`
# SchemaIterator:4598 27739 Filter ignore-databases value: test
# SchemaIterator:4598 27739 Filter ignore-databases value: information_schema
# SchemaIterator:4598 27739 Filter ignore-databases value: wc_process_monitor
# SchemaIterator:4598 27739 Filter ignore-databases value: rxdb_v1
# SchemaIterator:4598 27739 Filter ignore-databases value: mie
# SchemaIterator:4598 27739 Filter ignore-databases value: rxdb_utf8
# SchemaIterator:4594 27739 Filter ignore-tables value: mie table_checksum
# SchemaIterator:4598 27739 Filter ignore-engines value: mrg_myisam
# SchemaIterator:4598 27739 Filter ignore-engines value: federated
# SchemaIterator:4618 27739 Schema object filters: $VAR1 = {
# 'ignore-databases' => {
# information_schema => 1,
# mie => 1,
# rxdb_utf8 => 1,
# rxdb_v1 => 1,
# test => 1,
# wc_process_monitor => 1
# },
# 'ignore-engines' => {
# federated => 1,
# mrg_myisam => 1
# },
# 'ignore-tables' => {
# table_checksum => 'mie'
# }
# };
#
# SchemaIterator:4730 27739 Getting next schema object from dbh DBI::db=HASH(0x1440288)
# SchemaIterator:4734 27739 SHOW DATABASES
# SchemaIterator:4811 27739 Database information_schema is a system database, ignoring
# SchemaIterator:4816 27739 Database mie is in --ignore-databases list
# SchemaIterator:4816 27739 Database rxdb_utf8 is in --ignore-databases list
# SchemaIterator:4816 27739 Database rxdb_v1 is in --ignore-databases list
# SchemaIterator:4816 27739 Database test is in --ignore-databases list
# SchemaIterator:4816 27739 Database wc_process_monitor is in --ignore-databases list
# SchemaIterator:4737 27739 Found 361 databases
Use of uninitialized value $db in string eq at ./pt-table-checksum line 4919, <STDIN> line 1.
# Cxn:1514 27739 Disconnecting dbh DBI::db=HASH(0x143df08) undef
# Cxn:1514 27739 Disconnecting dbh DBI::db=HASH(0x1440288) undef

Dave Juntgen (djuntgen) on 2012-01-03
description: updated
Baron Schwartz (baron-xaprb) wrote :

Thanks for the bug report. We also need to check and ensure that performance_schema is treated as a system database and is ignored too.

tags: added: filters pt-table-checksum resume
tags: added: crash
Changed in percona-toolkit:
status: New → Confirmed
assignee: nobody → Daniel Nichter (daniel-nichter)
Brian Fraser (fraserbn) wrote :

The short version of this bug is that, if the database you're resuming from is in --ignore-databases, SchemaIterator will crash. Easy enough to avoid, but what should the behavior be here? In the branch currently linked to this bug, it does nothing: pt-table-checksum can't resume, so it just ends without doing any work. It would be ideal if we could warn, I think, but I doubt that'll be an easy change to make.

Daniel Nichter (daniel-nichter) wrote :

I think the behavior should be:

1. Get the resume db and tbl

2. If !$schema_iter->database_is_allowed || !$schema_iter->table_is_allowed then warn (unless --quiet) that resume would start on db.tbl but the db or table is filtered so resuming will begin instead with foo, where foo is the next permitted db tbl.

There might be a reason to skip the db or tbl that would be resumed. E.g. if db.foo is taking forever, the user ctrl-c's the tool, then does --ignore-table db.foo --resume because they know that table is too big and they just want to finish the rest of the tables, which case the warning might be nice to let the user know that tool is doing what they expect.

Brian Fraser (fraserbn) wrote :

Turns out that we actually had prior art for this! While --ignore-databases crashed, --ignore-tables had code to handle resuming from an ignored table. It acts exactly as you described, with the exception that it doesn't warn, it just PTDEBUGs and carries on. Should the new code follow suit?

Changed in percona-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers