pt-query-digest prints negative byte offset

Reported by Richard Lynch on 2011-11-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit
Low
Brian Fraser

Bug Description

I have added the requested information to the original bug report, whose status I can't change...

http://code.google.com/p/maatkit/issues/detail?id=1352

Daniel Nichter (daniel-nichter) wrote :

Basic summary of problem: pt-query-digest can print:

# Query 1: 0.08 QPS, 0.03x concurrency, ID 0xC94C6BB4AC84C91A at byte -2135329898

The "at byte" is wrong.

tags: added: pt-query-digest wrong-output
summary: - negative byte offset
+ pt-query-digest prints negative byte offset
Changed in percona-toolkit:
status: New → Confirmed
Brian Fraser (fraserbn) wrote :

Gosh, this one fell through the cracks. Running this now, I can't seem able to reproduce it; I tried pqd 1.0.2 and 2.1.5 against the 900MB log file, on Ubuntu 12 (64 bits), Debian 6 (32 bits, VM) and CentOS 5 (64 bits, VM), and all show positive byte offsets. However, I doubt that it was fixed -- Is anyone still seeing this?

Richard Lynch (google-r) wrote :

I think the original was on RHEL 5 32-bit...

I realized that Drupal queries were not the issue, and moved on with life, I'm afraid...

I'll try to reproduce with the same box I was on before.

Perhaps other fixes purged this one.

Brian Fraser (fraserbn) on 2012-11-11
Changed in percona-toolkit:
assignee: nobody → Brian Fraser (fraserbn)
Brian Fraser (fraserbn) on 2012-11-15
Changed in percona-toolkit:
status: Confirmed → In Progress
Brian Fraser (fraserbn) wrote :

While I wasn't able to reproduce this with a real world test case, I'm pretty sure I nailed down the cause: The printf format %d, which we use for the at byte output, is documented to return whatever the underlaying C implementation would return, so for a large enough index on a 32-bit machine, the values would wrap around.
The other possible cause of breakage would be tell() misbehaving on a large file, but I have no clue how to test that, and there's few chances of a workaround in any case; If someone does manage to reproduce this even with the fix in the attached branch, please create a new bug report!

Changed in percona-toolkit:
milestone: none → 2.1.7
Changed in percona-toolkit:
milestone: 2.1.7 → 2.1.8
Brian Fraser (fraserbn) on 2012-11-29
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
importance: Undecided → Low
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