Skip to content

Commit abf400e

Browse files
author
Nirbhay Choubey
committed
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]
1 parent 54b26b4 commit abf400e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/wsrep_sst_xtrabackup-v2.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ parse_cnf()
240240
get_footprint()
241241
{
242242
pushd $WSREP_SST_OPT_DATA 1>/dev/null
243-
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }')
243+
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c | awk 'END { print $1 }')
244244
if my_print_defaults -c $WSREP_SST_OPT_CONF xtrabackup | grep -q -- "--compress";then
245245
# QuickLZ has around 50% compression ratio
246246
# When compression/compaction used, the progress is only an approximate.

scripts/wsrep_sst_xtrabackup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ parse_cnf()
205205
get_footprint()
206206
{
207207
pushd $WSREP_SST_OPT_DATA 1>/dev/null
208-
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }')
208+
payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | du --files0-from=- --block-size=1 -c | awk 'END { print $1 }')
209209
if my_print_defaults -c $WSREP_SST_OPT_CONF xtrabackup | grep -q -- "--compress";then
210210
# QuickLZ has around 50% compression ratio
211211
# When compression/compaction used, the progress is only an approximate.

0 commit comments

Comments
 (0)