pt-kill --log-dsn timestamp is wrong

Reported by Walter Heck on 2012-12-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit
Medium
Brian Fraser

Bug Description

I'm running pt-kill as a cronjob with the following command:
<pre>
[root@orrville ~]# crontab -l
*/30 * * * * /usr/bin/pt-kill --user root --password r00t --kill --match-user api_filter --victims oldest --any-busy-time 300 --run-time 600 --verbose --create-log-table --log-dsn D=test,t=ptkill
</pre>

When it logs to the table, it seems to use the amount of seconds it has been running as the timestamp, while the unixtimestamp of the current time and date would be much more helpful:

<pre>
MariaDB [test]> select * from ptkill order by kill_id desc limit 2;
+---------+-----------+---------------------+-------------------------------------------------+------------+---------+------------+----------------------+---------------+---------+------+-------+------+---------+
| kill_id | server_id | timestamp | reason | kill_error | Id | User | Host | db | Command | Time | State | Info | Time_ms |
+---------+-----------+---------------------+-------------------------------------------------+------------+---------+------------+----------------------+---------------+---------+------+-------+------+---------+
| 205 | 10076 | 1970-01-01 00:00:02 | Query matches User spec
Query matches User spec | | 5638802 | api_filter | 192.168.100.93:60309 | yomama | Sleep | 426 | | NULL | NULL |
| 203 | 10076 | 1970-01-01 00:00:32 | Query matches User spec | | 5638712 | api_filter | 192.168.100.66:58399 | yomama | Sleep | 406 | | NULL | NULL |
+---------+-----------+---------------------+-------------------------------------------------+------------+---------+------------+----------------------+---------------+---------+------+-------+------+---------+
2 rows in set (0.00 sec)
</pre>

Walter Heck (walterheck) wrote :

This is on centos 5.8 and percona-toolkit 2.0.3 (sorry, can't test with latest):

[root@orrville ~]# cat /etc/redhat-release
CentOS release 5.8 (Final)

Walter Heck (walterheck) wrote :

Just confirmed it happens with 2.1.7 as well..

tags: added: pt-kill wrong-output
Changed in percona-toolkit:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.1.8
Brian Fraser (fraserbn) on 2012-12-04
Changed in percona-toolkit:
assignee: nobody → Brian Fraser (fraserbn)
Brian Fraser (fraserbn) on 2012-12-04
Changed in percona-toolkit:
status: Triaged → In Progress
summary: - pt-kill in non-daemon mode logs timestamps incorrectly
+ pt-kill --log-dsn timestamp is wrong
Brian Fraser (fraserbn) on 2012-12-11
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers