Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1736

pt-kill ignores --busy-time and --kill-busy-commands=Query when there is a process with Command=Execute

Details

    • Bug
    • Status: Done
    • High
    • Resolution: Fixed
    • 3.0.13
    • 3.1.0
    • None

    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.

       

       

      Attachments

        Activity

          People

            carlos.salguero Carlos Salguero (Inactive)
            leonardo.bacchi.fernandes Leonardo Bacchi Fernandes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 1 day
                1d

                Smart Checklist