pt-stalk disk space checks wrong on 32bit platforms

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

Bug Description

On 64-bit platforms, awk '{printf("%d", 94409664*1024)}' yields 96,675,495,936. On 32-bit platforms it yields 2,147,483,647; i.e. the 32bit signed limit. Therefore, lines like

local free_bytes=$(cat "$file" | awk '/^\//{printf("%d",$4 * 1024)}');

in collect.sh return the wrong value because hard drives these days tend to have much more than 2^31 bytes of storage.

Solution: use Perl.

Changed in percona-toolkit:
assignee: nobody → Daniel Nichter (daniel-nichter)
tags: added: pt-stalk
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

This was fixed in lib/bash/safeguards.sh and merged into 2.0 branch in http://bazaar.launchpad.net/~percona-toolkit-dev/percona-toolkit/2.0/revision/189

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :
Changed in percona-toolkit:
status: In Progress → Fix Committed
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-483

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.