LP #1070916: pt-mysql-summary may report the wrong cnf file

Description

**Reported in Launchpad by Daniel Nichter last update 16-11-2012 00:08:54

Finally digging into this failure:

  1. Failed '"/tmp/12347/my.sandbox.cnf" == "/tmp/12345/my.sandbox.cnf"'

  2. /tmp/percona-toolkit.test/collect_mysql_info/mysqld-instances:

  3. PID TTY STAT TIME COMMAND

  4. 1427 ? Sl 0:13 /home/jenkins/mysql-bin/mysql-5.5.24-i386-barebones/bin/mysqld --defaults-file=/tmp/12347/my.sandbox.cnf

  5. 20928 ? Sl 0:07 /home/jenkins/mysql-bin/mysql-5.5.24-i386-barebones/bin/mysqld --defaults-file=/tmp/12345/my.sandbox.cnf

  6. 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.

Environment

None

Smart Checklist

Activity

lpjirasync January 24, 2018 at 4:01 PM

**Comment from Launchpad by: Daniel Nichter on: 24-10-2012 17:17:05

Before:

not ok 15 - collect_mysql_info.t ps-mysqld-005.txt port 12345 (bug 1070916)

  1. 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.

Done

Details

Assignee

Reporter

Priority

Smart Checklist

Created January 24, 2018 at 4:00 PM
Updated January 24, 2018 at 4:01 PM
Resolved January 24, 2018 at 4:01 PM

Flag notifications