pt-deadlock-logger doesn't handle usernames with dashes

Reported by Martin Arrieta on 2012-11-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit
Low
Brian Fraser

Bug 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.

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

description: updated
Brian Fraser (fraserbn) on 2012-11-22
Changed in percona-toolkit:
status: New → Triaged
assignee: nobody → Brian Fraser (fraserbn)
Brian Fraser (fraserbn) on 2012-11-23
Changed in percona-toolkit:
status: Triaged → In Progress
milestone: none → 2.1.8
Changed in percona-toolkit:
importance: Undecided → Low
Changed in percona-toolkit:
status: In Progress → Fix Committed
summary: - pt-deadlock-logger problem when the user have a dash in the name
+ pt-deadlock-logger doesn't handle usernames with dashes
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