Skip to content

Commit

Permalink
MDEV-6771 : Incorrect Size for Transfer Reported to pv
Browse files Browse the repository at this point in the history
xargs may split the input and execute them in batches for
large number of files. As a result xtrabackup sst script
may feed incorrect size to pv.
Fixed by piping the files to du directly (du --files0-from=-).

[Based on suggestions from Brad Jorgensen]
  • Loading branch information
Nirbhay Choubey committed Jan 13, 2015
1 parent 54b26b4 commit abf400e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/wsrep_sst_xtrabackup-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ parse_cnf()
get_footprint()
{
pushd $WSREP_SST_OPT_DATA 1>/dev/null
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }')
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c | awk 'END { print $1 }')
if my_print_defaults -c $WSREP_SST_OPT_CONF xtrabackup | grep -q -- "--compress";then
# QuickLZ has around 50% compression ratio
# When compression/compaction used, the progress is only an approximate.
Expand Down
2 changes: 1 addition & 1 deletion scripts/wsrep_sst_xtrabackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ parse_cnf()
get_footprint()
{
pushd $WSREP_SST_OPT_DATA 1>/dev/null
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }')
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c | awk 'END { print $1 }')
if my_print_defaults -c $WSREP_SST_OPT_CONF xtrabackup | grep -q -- "--compress";then
# QuickLZ has around 50% compression ratio
# When compression/compaction used, the progress is only an approximate.
Expand Down

0 comments on commit abf400e

Please sign in to comment.