pt-kill not killing connections when execute-command is set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
While testing pt-kill I discovered that for some reason, it appears that the "execute-command" is causing the "kill" option to fail. Simple remove the execute-command option and everything works as expected. Below is an example I created to test. and show the issue.
Configuration: .pt-kill.conf
busy-time=30s
log=/root/
pid=/root/
execute-
match-info=^SELECT
kill
print
MySQL Version:
mysqld Ver 5.6.24-72.2 for Linux on x86_64 (Percona Server (GPL), Release 72.2, Revision 8d0f85b)
Percona Toolkit Version:
pt-kill 2.2.14
Queries run and output:
[root@tslls ~]# date; mysql --comments -e "SELECT @@server_id, SLEEP(65) /* First Query */;"; date
Sat May 30 23:10:28 UTC 2015
ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query
Sat May 30 23:11:02 UTC 2015
[root@tslls ~]# date; mysql --comments -e "SELECT @@server_id, SLEEP(65) /* Second Query */;"; date
Sat May 30 23:11:43 UTC 2015
+------
| @@server_id | SLEEP(65) |
+------
| 0 | 0 |
+------
Sat May 30 23:12:48 UTC 2015
[root@tslls ~]# touch /tmp/pt-
execute-command output:
[root@tslls ~]# cat execute.log
Sat May 30 23:11:02 UTC 2015
Sat May 30 23:12:20 UTC 2015
Sat May 30 23:12:39 UTC 2015
I was able to repeat this using Tom's test case. It looks like pt-kill will succeed on killing the first query, but all subsequent queries it will fail to kill on "MySQL server has gone away" at /usr/bin/pt-kill line 6806. And it looks like it won't reestablish the database connection until the next "SHOW FULL PROCESSLIST" fails after the two failed kill attempts.