pt-table-checksum ignores slave-user and slave-password

Bug #1651002 reported by n0
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Carlos Salguero

Bug Description

The command line parameters -slave-user=USER --slave-password=PASS
are being ignored and percona still tries to connect to slave using master credentials
which willl result in the error -
Cannot connect to h=slave

I think this is happening because the `get_slave` method (L5043) calls recurse_to_slave(L5065) with the master connection settings and only modifies the user and password in the callback.

Tags: i163497 pt101
Revision history for this message
Jericho Rivera (jericho-rivera) wrote :

Please share actual pt-table-checksum version used and pt-table-checksum log output if it's still available.

Changed in percona-toolkit:
status: New → Incomplete
Revision history for this message
n0 (yonjah) wrote :

pt-table-checksum version is 2.2.19

I've attached the debug log, but I found it useless in this case since it never actually let you know which credentials are used to connect to the slave.
Adding an extra output to STDERR on line 5139 which will output the $EVAL_ERROR will show that the connection is attempted with the default user

Changed in percona-toolkit:
status: Incomplete → New
Revision history for this message
Jericho Rivera (jericho-rivera) wrote :

Was able to reproduce with:

pt-table-checksum 2.2.20

PTDEBUG=1 pt-table-checksum --slave-user=slave --slave-password=slave1 --recursion-method=hosts h=127.0.0.1,P=22695,u=master,p=master1 > hosts.log 2>&1

# OptionParser:2217 16229 Got option slave-user = slave
# OptionParser:2217 16229 Got option slave-password = slave1
# OptionParser:2217 16229 Got option recursion-method = hosts

# DSNParser:1417 16229 Parsing h=127.0.0.1,P=22696
# DSNParser:1436 16229 Finding value for A
# DSNParser:1446 16229 Copying value for A from defaults
# DSNParser:1436 16229 Finding value for h
# DSNParser:1436 16229 Finding value for F
# DSNParser:1446 16229 Copying value for F from defaults
# DSNParser:1436 16229 Finding value for D
# DSNParser:1446 16229 Copying value for D from defaults
# DSNParser:1436 16229 Finding value for P
# DSNParser:1436 16229 Finding value for S
# DSNParser:1446 16229 Copying value for S from defaults
# DSNParser:1436 16229 Finding value for t
# DSNParser:1446 16229 Copying value for t from defaults
# DSNParser:1436 16229 Finding value for u
# DSNParser:1442 16229 Copying value for u from previous DSN
# DSNParser:1436 16229 Finding value for p
# DSNParser:1442 16229 Copying value for p from previous DSN
# MasterSlave:5187 16229 Found 1 slaves
# MasterSlave:5164 16229 Recursing from P=22695,h=127.0.0.1,p=...,u=master to P=22696,h=127.0.0.1,p=...,u=master
# MasterSlave:5121 16229 Recursion methods: hosts
# DSNParser:1530 16229 DBI:mysql:;host=127.0.0.1;port=22696;mysql_read_default_group=client
# DSNParser:1579 16229 DBI:mysql:;host=127.0.0.1;port=22696;mysql_read_default_group=client master master1 AutoCommit=>1, PrintError=>0, RaiseError=>1, mysql_enable_utf8=>0, ShowErrorStatement=>1
# DSNParser:1579 16229 DBI:mysql:;host=127.0.0.1;port=22696;mysql_read_default_group=client master master1 AutoCommit=>1, PrintError=>0, RaiseError=>1, mysql_enable_utf8=>0, ShowErrorStatement=>1
Cannot connect to P=22696,h=127.0.0.1,p=...,u=master

As usual with recursion-method=dsn where dsn column includes slave user and password will work.

Changed in percona-toolkit:
status: New → Confirmed
Changed in percona-toolkit:
status: Confirmed → Triaged
importance: Undecided → Medium
assignee: nobody → Carlos Salguero (carlos-salguero)
milestone: none → 2.2.21
Jaime Sicam (jssicam)
tags: added: i163497
Changed in percona-toolkit:
status: Triaged → In Progress
tags: added: pt101
Revision history for this message
Carlos Salguero (carlos-salguero) wrote :
Changed in percona-toolkit:
status: In Progress → Fix Committed
milestone: 2.2.21 → 3.0.2
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-722

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.