pt-table-checksum --defaults-file isn't used for slaves
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Daniel Nichter |
Bug Description
The username and password specified /etc/percona.cnf are applied to only localhost, not any of the slaves.
In this case, I have a master (10.0.0.1) and one slave (10.0.0.2).
I am trying to run the checksum from the master.
%> cat /etc/*release
CentOS release 5.7 (Final)
%> pt-table-checksum --version
pt-table-checksum 2.1.2
%> pt-table-checksum --defaults-file /etc/percona.cnf --databases db1 localhost
Cannot connect to h=10.0.0.2
%> export PTDEBUG=1
%> pt-table-checksum --defaults-file /etc/percona.cnf --databases db1 localhost
...
# OptionParser:794 16427 Got option defaults-file = /etc/percona.cnf
...
# OptionParser:1014 16427 Nothing to validate for option defaults-file type s value /etc/percona.cnf
...
# DSNParser:140 16427 DSN string made from options: F=/etc/
# DSNParser:80 16427 Parsing F=/etc/
...
# DSNParser:192 16427 DBI:mysql:
# DSNParser:238 16427 DBI:mysql:
...
# MasterSlave:2659 16427 Looking for slaves on F=/etc/
...
# MasterSlave:2763 16427 DBI::db=
# DSNParser:80 16427 Parsing h=10.0.0.2
...
# MasterSlave:2637 16427 Recursing from F=/etc/
# DSNParser:192 16427 DBI:mysql:
# DSNParser:238 16427 DBI:mysql:
# DSNParser:279 16427 DBI connect(
#
# DSNParser:238 16427 DBI:mysql:
# DSNParser:279 16427 DBI connect(
#
Cannot connect to h=10.0.0.2
I think that the correct behavior would be for --defaults-file options to propagate to all slaves (otherwise, the option isn't really useful)
Related branches
- Daniel Nichter: Approve
-
Diff: 14 lines (+2/-2)1 file modifiedbin/pt-table-checksum (+2/-2)
Changed in percona-toolkit: | |
assignee: | nobody → Daniel Nichter (daniel-nichter) |
summary: |
- --defaults-file is ignored for slave(s) in pt-table-checksum + pt-table-checksum --defaults-file isn't used for slaves |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Bug confirmed.
That is because DSN 'F' (defaults-file) is marked as not-copy in the options.
This is the patch/workaround (applies over bzr):
======= ======= ======= ======= ======= ===
diff -u /home/raghavend ra/.Work/ code/percona- toolkit/ bin/pt- table-checksum /dev/shm/ ra/.Work/ code/percona- toolkit/ bin/pt- table-checksum 2012-08-08 13:30:41.325087753 +0530 pt-table- checksum 2012-08-08 13:28:25.086938877 +0530
--- /home/raghavend
+++ /dev/shm/
@@ -9611,7 +9611,7 @@
=item * F
-dsn: mysql_read_ default_ file; copy: no default_ file; copy: yes
+dsn: mysql_read_
Only read default options from the given file
======= ======= ======= ======= ======= ======
Confirmed that it works with the patch.
I wonder if the 'copy' ability of any of the DSNs can be made as option.