Description
When running pt-kill with the parameters below, pt-kill prints KILL on threads with Command=Execute or Command=Prepare running for only 0 seconds.
./pt-kill --busy-time 60 --print --user=msandbox --password=msandbox --socket=/tmp/mysql_sandbox5800.sock --match-user "msandbox" --match-info "(SELECT|select)" --interval 1 --kill-busy-commands=Query
2019-06-11T15:44:23 KILL 4973 (Prepare 0 sec) SELECT DISTINCT c FROM sbtest21 WHERE id BETWEEN ? AND ? ORDER BY c
2019-06-11T15:44:24 KILL 4972 (Execute 0 sec) SELECT SUM(k) FROM sbtest46 WHERE id BETWEEN ? AND ?
2019-06-11T15:44:26 KILL 4973 (Execute 0 sec) SELECT SUM(k) FROM sbtest10 WHERE id BETWEEN ? AND ?
How to reproduce:
Create a sandbox and use sysbench:
shell> sysbench /home/juan.arruti/usr/share/sysbench/oltp_read_only.lua --table-size=10000 --tables=50 --threads=16 --db-driver=mysql --mysql-socket=/tmp/mysql_sandbox5800.sock ysql-user=msandbox --mysql-password=msandbox --time=60 prepare
shell> sysbench /home/juan.arruti/usr/share/sysbench/oltp_read_only.lua --table-size=10000 --tables=50 --threads=16 --db-driver=mysql --mysql-socket=/tmp/mysql_sandbox5800.sock ysql-user=msandbox --mysql-password=msandbox --time=60 run
Then run pt-kill with:
./pt-kill --busy-time 60 --print --user=msandbox --password=msandbox --socket=/tmp/mysql_sandbox5800.sock --match-user "msandbox" --match-info "(SELECT|select)" --interval 1 --kill-busy-commands=Query
Expected Results:
Only queries running for more than 60 seconds and with Command=Query to be printed for kill.