summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-01-13 13:10:07 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2015-01-13 13:10:07 -0500
commit33b4fab8679a2e34a97e167a2a88dc5ea0a5686a (patch)
tree30fe4a9deddf3bc5d95aa6406747e225df5dcc01
parent743a28ea5714459fe09782dab9a4a7a0b0ff6673 (diff)
downloadmariadb-git-33b4fab8679a2e34a97e167a2a88dc5ea0a5686a.tar.gz
MDEV-6771 : Incorrect Size for Transfer Reported to pv
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]
-rw-r--r--scripts/wsrep_sst_xtrabackup-v2.sh2
-rw-r--r--scripts/wsrep_sst_xtrabackup.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh
index 865547ad9d8..90892f9574f 100644
--- a/scripts/wsrep_sst_xtrabackup-v2.sh
+++ b/scripts/wsrep_sst_xtrabackup-v2.sh
@@ -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.
diff --git a/scripts/wsrep_sst_xtrabackup.sh b/scripts/wsrep_sst_xtrabackup.sh
index 6b33eabee23..dd4060e6961 100644
--- a/scripts/wsrep_sst_xtrabackup.sh
+++ b/scripts/wsrep_sst_xtrabackup.sh
@@ -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.