pt-deadlock-logger introduces a noise to MySQL

Bug #1258135 reported by Roman Vynar
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
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

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
Revision history for this message
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
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-804

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.