pt-mysql-summary may report the wrong cnf file

Bug #1070916 reported by Daniel Nichter
6
This bug affects 1 person
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/12347/my.sandbox.cnf" == "/tmp/12345/my.sandbox.cnf"'
# /tmp/percona-toolkit.test/collect_mysql_info/mysqld-instances:
# PID TTY STAT TIME COMMAND
# 1427 ? Sl 0:13 /home/jenkins/mysql-bin/mysql-5.5.24-i386-barebones/bin/mysqld --defaults-file=/tmp/12347/my.sandbox.cnf
# 20928 ? Sl 0:07 /home/jenkins/mysql-bin/mysql-5.5.24-i386-barebones/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf
# 29930 ? Sl 0:00 /home/jenkins/mysql-bin/mysql-5.5.24-i386-barebones/bin/mysqld --defaults-file=/tmp/12346/my.sandbox.cnf

mysql_collect_info.find_my_cnf_file() doesn't actually work correctly. It seems to always return what's at the top of the ps output.

Related branches

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Before:

not ok 15 - collect_mysql_info.t ps-mysqld-005.txt port 12345 (bug 1070916)
# Failed '"/tmp/12347/my.sandbox.cnf" == ""'

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.

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
Brian Fraser (fraserbn)
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-590

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

Other bug subscribers

Remote bug watches

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