Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-575

LP #1043528: pt-deadlock-logger can't parse db/tbl/index on partitioned tables

Details

    Description

      **Reported in Launchpad by Baron Schwartz last update 16-11-2012 00:04:29

      Newer versions of MySQL add the partition information to lock output in SHOW ENGINE INNODB STATUS, and pt-deadlock-logger doesn't expect this. Here is a sample:

          • (1) WAITING FOR THIS LOCK TO BE GRANTED:
            RECORD LOCKS space id 34511934 page no 8475 n bits 296 index `PRIMARY` of table `mydb`.`mytbl` /* Partition `cl71` */ trx id 1E29B11F9 lock_mode X locks rec but not gap waiting

      A small change to the pattern, just before "trx id", fixes this:

      @@ -2736,7 +2736,7 @@
      $hash->

      {wait_hold}

      = $what eq 'WAITING FOR THIS LOCK TO BE GRANTED' ? 'w' : 'h';
      @{$hash}

      { qw(lock_type idx db tbl txn_id lock_mode) }

      = $body

      • =~ m{^(RECORD|TABLE) LOCKS? (?:space id \d+ page no \d+ n bits \d+ index `?$n`? of )?table `$n(?:/|`\.`)$n` trx id $t lock.mode (\S+)}m;
        + =~ m{^(RECORD|TABLE) LOCKS? (?:space id \d+ page no \d+ n bits \d+ index `?$n`? of )?table `$n(?:/|`\.`)$n`.*?trx id $t lock.mode (\S+)}m;
        if ( $hash-> {txn_id} ) {
        my ( $high, $low ) = $hash->{txn_id}

        =~ m/^(\d+) (\d+)$/;
        $hash->

        {txn_id}

        = $high ? ( $low + ($high << 32) ) : $low;

      Attachments

        Activity

          People

            Unassigned Unassigned
            lpjirasync lpjirasync (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist