pt-deadlock-logger introduces a noise to MySQL

Bug #1258135 reported by Roman Vynar on 2013-12-05
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Toolkit
Low
Frank Cizmich

Bug Description

Hello,

pt-deadlock-logger introduces a noise to MySQL because it does:
INSERT IGNORE INTO `percona`.`deadlocks` (`server`,`ts`,`thread`,`txn_id`,`txn_time`,`user`,`hostname`,`ip`,`db`,`tbl`,`idx`,`lock_type`,`lock_mode`,`wait_hold`,`victim`,`query`)
 VALUES ...

every minute on every deadlock that appears under SHOW ENGINE INNODB STATUS.

For example, say a deadlock happened 1 year ago, and MySQL keeps it in the memory and pt-deadlock-logger will INSERT it into percona.deadlocks table every minute all the time until restart. This introduces a noise.
If we expect to see no writes on the master, pt-deadlock-logger should not be a problem and should not introduce those unnecessary writes.

The suggestion is to do SELECT to check whether a row exists in percona.deadlocks table and only do INSERT otherwise.

Thanks.

Related branches

lp:~percona-toolkit-dev/percona-toolkit/pt-deadlock-logger-introduces-a-noise-to-mysql-1258135
Percona Toolkit developers: Pending requested 2014-07-03
Merged into lp:percona-toolkit at revision 607
Percona Toolkit developers: Pending requested 2014-05-22
Changed in percona-toolkit:
assignee: nobody → Frank Cizmich (frank-cizmich)
Changed in percona-toolkit:
milestone: none → 2.2.9
status: New → Fix Committed
importance: Undecided → Low
Frank Cizmich (frank-cizmich) wrote :

Fixed by comparing with the last deadlock fingerprint before issuing insert query.

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