pt-duplicate-key-checker error parsing InnoDB table with no PK or unique keys

Bug #1036804 reported by Jay Janssen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
High
Daniel Nichter

Bug Description

Getting this:

Use of uninitialized value $ddl in pattern match (m//) at /usr/bin/pt-duplicate-key-checker line 408.

After a few duplicate keys are outputted.

$ pt-duplicate-key-checker --version
pt-duplicate-key-checker 2.1.3

Let me know if you need any more information.

Related branches

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Jay, can you provide a SHOW CREATE TABLE or few that reproduces this?

tags: added: crash pt-duplicate-key-checker
Changed in percona-toolkit:
status: New → Triaged
Revision history for this message
Jay Janssen (jay-janssen) wrote :

Daniel, I am actively working with my customer where I saw this this week, but I'm under multiple NDAs, so I can't post the schema here publicly. I'll see about getting a copy somewhere internal where you can get at it.

Revision history for this message
Jay Janssen (jay-janssen) wrote : Re: [Bug 1036804] pt-duplicate-key-checker failing

On Aug 14, 2012, at 5:10 PM, Daniel Nichter <email address hidden> wrote:

> Jay, can you provide a SHOW CREATE TABLE or few that reproduces this?

Think I found the problem. 'mysqldump -Ad' produces this:

mysqldump: Got error: 1168: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist when using LOCK TABLES

If I add a -f to the mysqldump, I get a few more errors as well.

Looks like pt-duplicate-key-checker uses DBI, but perhaps there is some way to skip over errors in the schema like this? (same request for the table analyzer in pt-mysql-summary)

Jay Janssen, Senior MySQL Consultant, Percona Inc.
http://about.me/jay.janssen
Percona Live in NYC Oct 1-2nd: http://www.percona.com/live/nyc-2012/

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

I can reproduce this, so I'll write a test case, fix it, etc. etc.

Changed in percona-toolkit:
status: Triaged → In Progress
importance: Undecided → High
assignee: nobody → Daniel Nichter (daniel-nichter)
milestone: none → 2.1.4
summary: - pt-duplicate-key-checker failing
+ pt-duplicate-key-checker error parsing InnoDB table with no PK or unique
+ keys
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Jay, you reported a different crash, but the PTDEBUG has more of these crashes:

Error checking `db`.`table` for duplicate keys: Use of uninitialized value $ck_cols in regexp compilation at /usr/bin/pt-duplicate-key-checker line 2371.

That's fixed. I'll look into the similar error for $ddl.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Jay, from the logs it looks like the tool saw a table, but that table was gone by the time it got to checking it. So I've wrapped each table's check in an eval. If this happens again, it will just warn and continue rather than crashing.

Changed in percona-toolkit:
status: In Progress → Fix Committed
Revision history for this message
Jay Janssen (jay-janssen) wrote :

I downloaded the updated pt-duplicate-key-checker from the associated branch and it seems to run correctly

Brian Fraser (fraserbn)
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-327

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.