[MDEV-6771] Incorrect Size for Transfer Reported to pv Created: 2014-09-24  Updated: 2015-01-13  Resolved: 2015-01-13

Status: Closed
Project: MariaDB Server
Component/s: Galera SST
Affects Version/s: 10.0.13
Fix Version/s: 5.5.42-galera, 10.0.16-galera

Type: Bug Priority: Minor
Reporter: Brad Jorgensen Assignee: Nirbhay Choubey (Inactive)
Resolution: Fixed Votes: 0
Labels: sst
Environment:

CentOS 6.5



 Description   

The function that is used by the xtrabackup and xtrabackup-v2 SST scripts to get the size of the backup (get_footprint) can return an incorrect size. From what I've been able to find, it is because xargs batches data above a certain threshold. The issue is in this line:

payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }')

The batching from xargs can cause du to print multiple total lines. awk then grabs the last one so the reported size is just the size of the files from the last batch from xargs. One option is to not use xargs and instead catch the piped data with --files0-from=-, but get_footprint from du can use file name patterns which is simpler and worked for me. I'm not sure if it will work with other versions of du, though.

without find:

payload=$(du --block-size=1 -c  **/*.ibd **/*.MYI **/*.MYD ibdata1  | awk 'END { print $1 }')

using find:

payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c | awk 'END { print $1 }')

Also, since the innodb_data_file_path can be changed, it would be helpful to have the script find the location of the data file and use that path instead of assuming it's in the work directory with everything else.



 Comments   
Comment by Nirbhay Choubey (Inactive) [ 2015-01-13 ]

http://bazaar.launchpad.net/~maria-captains/maria/maria-5.5-galera/revision/3553
http://bazaar.launchpad.net/~maria-captains/maria/maria-10.0-galera/revision/3912

Generated at Thu Feb 08 07:14:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.