Activity log for bug #1082104

Date Who What changed Old value New value Message
2012-11-22 16:57:48 Martin Arrieta bug added bug
2012-11-22 16:59:43 Martin Arrieta description When you create a deadlock with a user that have a dash in the name, pt-deadlock-logger will not store the user name and will store the host name in the user field instead. Deadlock example: ##### With a user name with a dash in the name (mar-tin) ##### ------------------------ LATEST DETECTED DEADLOCK ------------------------ 121119 18:56:52 *** (1) TRANSACTION: TRANSACTION 5CD, ACTIVE 10 sec, process no 9490, OS thread id 139862860961536 starting index read mysql tables in use 1, locked 1 LOCK WAIT 6 lock struct(s), heap size 1248, 3 row lock(s), undo log entries 1 MySQL thread id 26, query id 5024 localhost mar-tin Updating UPDATE parent SET age=age+1 WHERE id=1 *** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 0 page no 4624 n bits 72 index `PRIMARY` of table `employees`.`parent` trx id 5CD lock_mode X locks rec but not gap waiting *** (2) TRANSACTION: TRANSACTION 5CC, ACTIVE 23 sec, process no 9490, OS thread id 139862861227776 starting index read mysql tables in use 1, locked 1 7 lock struct(s), heap size 1248, 4 row lock(s), undo log entries 2 MySQL thread id 38, query id 5043 localhost mar-tin Updating UPDATE parent SET age=age+1 WHERE id=2 *** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 0 page no 4624 n bits 72 index `PRIMARY` of table `employees`.`parent` trx id 5CC lock_mode X locks rec but not gap *** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 0 page no 4624 n bits 72 index `PRIMARY` of table `employees`.`parent` trx id 5CC lock_mode X locks rec but not gap waiting *** WE ROLL BACK TRANSACTION (1) > select * from deadlocks\G *************************** 1. row *************************** server: Localhost ts: 2012-11-19 18:56:52 thread: 26 txn_id: 0 txn_time: 10 user: localhost hostname: ip: db: employees tbl: parent idx: PRIMARY lock_type: RECORD lock_mode: X wait_hold: w victim: 1 query: UPDATE parent SET age=age+1 WHERE id=1 *************************** 2. row *************************** server: Localhost ts: 2012-11-19 18:56:52 thread: 38 txn_id: 0 txn_time: 23 user: localhost <------ Here is the error. hostname: ip: db: employees tbl: parent idx: PRIMARY lock_type: RECORD lock_mode: X wait_hold: w victim: 0 query: UPDATE parent SET age=age+1 WHERE id=2 Thanks! Martin Arrieta @martinarrietac When you create a deadlock with a user that have a dash in the name, pt-deadlock-logger will not store the user name and will store the host name in the user field instead. pt-deadlock-logger version 2.1.7 Deadlock example: ##### With a user name with a dash in the name (mar-tin) ##### ------------------------ LATEST DETECTED DEADLOCK ------------------------ 121119 18:56:52 *** (1) TRANSACTION: TRANSACTION 5CD, ACTIVE 10 sec, process no 9490, OS thread id 139862860961536 starting index read mysql tables in use 1, locked 1 LOCK WAIT 6 lock struct(s), heap size 1248, 3 row lock(s), undo log entries 1 MySQL thread id 26, query id 5024 localhost mar-tin Updating UPDATE parent SET age=age+1 WHERE id=1 *** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 0 page no 4624 n bits 72 index `PRIMARY` of table `employees`.`parent` trx id 5CD lock_mode X locks rec but not gap waiting *** (2) TRANSACTION: TRANSACTION 5CC, ACTIVE 23 sec, process no 9490, OS thread id 139862861227776 starting index read mysql tables in use 1, locked 1 7 lock struct(s), heap size 1248, 4 row lock(s), undo log entries 2 MySQL thread id 38, query id 5043 localhost mar-tin Updating UPDATE parent SET age=age+1 WHERE id=2 *** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 0 page no 4624 n bits 72 index `PRIMARY` of table `employees`.`parent` trx id 5CC lock_mode X locks rec but not gap *** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 0 page no 4624 n bits 72 index `PRIMARY` of table `employees`.`parent` trx id 5CC lock_mode X locks rec but not gap waiting *** WE ROLL BACK TRANSACTION (1) > select * from deadlocks\G *************************** 1. row ***************************    server: Localhost        ts: 2012-11-19 18:56:52    thread: 26    txn_id: 0  txn_time: 10      user: localhost  hostname:        ip:        db: employees       tbl: parent       idx: PRIMARY lock_type: RECORD lock_mode: X wait_hold: w    victim: 1     query: UPDATE parent SET age=age+1 WHERE id=1 *************************** 2. row ***************************    server: Localhost        ts: 2012-11-19 18:56:52    thread: 38    txn_id: 0  txn_time: 23      user: localhost <------ Here is the error.  hostname:        ip:        db: employees       tbl: parent       idx: PRIMARY lock_type: RECORD lock_mode: X wait_hold: w    victim: 0     query: UPDATE parent SET age=age+1 WHERE id=2 Thanks! Martin Arrieta @martinarrietac
2012-11-22 17:02:24 Brian Fraser percona-toolkit: status New Triaged
2012-11-22 17:02:26 Brian Fraser percona-toolkit: assignee Brian Fraser (fraserbn)
2012-11-23 22:12:28 Brian Fraser percona-toolkit: status Triaged In Progress
2012-11-23 22:12:32 Brian Fraser percona-toolkit: milestone 2.1.8
2012-11-23 22:13:00 Brian Fraser branch linked lp:~percona-toolkit-dev/percona-toolkit/fix-1082104-pt-deadlock-logger-username-dash
2012-12-04 17:32:52 Daniel Nichter percona-toolkit: importance Undecided Low
2012-12-20 17:44:50 Daniel Nichter percona-toolkit: status In Progress Fix Committed
2012-12-21 18:45:20 Daniel Nichter summary pt-deadlock-logger problem when the user have a dash in the name pt-deadlock-logger doesn't handle usernames with dashes
2013-01-14 22:18:07 Daniel Nichter percona-toolkit: status Fix Committed Fix Released