pt-mysql-summary may report the wrong cnf file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Daniel Nichter |
Bug Description
Finally digging into this failure:
# Failed '"/tmp/
# /tmp/percona-
# PID TTY STAT TIME COMMAND
# 1427 ? Sl 0:13 /home/jenkins/
# 20928 ? Sl 0:07 /home/jenkins/
# 29930 ? Sl 0:00 /home/jenkins/
mysql_collect_
Related branches
- Daniel Nichter: Approve
-
Diff: 250 lines (+93/-46)6 files modifiedbin/pt-mysql-summary (+13/-14)
lib/bash/collect_mysql_info.sh (+16/-15)
t/lib/bash/collect_mysql_info.sh (+53/-11)
t/lib/bash/report_mysql_info.sh (+1/-1)
t/pt-mysql-summary/pt-mysql-summary.t (+6/-5)
t/pt-mysql-summary/samples/ps-mysqld-005.txt (+4/-0)
summary: |
- pt-mysql-summary may get the wrong cnf file + pt-mysql-summary may report the wrong cnf file |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Before:
not ok 15 - collect_ mysql_info. t ps-mysqld-005.txt port 12345 (bug 1070916) 12347/my. sandbox. cnf" == ""'
# Failed '"/tmp/
Problem was:
if test -n "$port" && grep -- "/mysqld. *--port= $port" "${file}" >/dev/null 2>&1 ; then
If a port was given but it wasn't found, then it just used the first MySQL instance whose cnf would then be reported. So in this test case port 12345's cnf is searched for, but not found, so the first instance is used, 12347, which creates a false-positive.