Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.11.8, 11.4.2
-
FreeBSD 14.1-p3
Description
Two issues with the get_footprint() function within the wsrep_sst_mariabackup shell script, both centered on its use of the "du" command to get the size of the files to be transferred:
1) The --files0-from and --block-size options to du are Linux-specific, and don't work on (for example) BSD systems.
2) On Linux, it needs the --apparent-size option, or perhaps the --bytes option in place of --block-size. This becomes important if the database is on ZFS with compression enabled – without --apparent-size, it will report the compressed size instead of the uncompressed size. BSD's "du" does the same thing, and there's an -A option there to compensate. This is particularly obvious with files like ibdata1 on a fairly fresh install, as it tends to be full of 0x00 initially.
I have a preliminary patch for both issues, based on the version in MariaDB 11.4.3, but have not yet tested it.
If you're impatient, one possible replacement for the du + awk construct on at least FreeBSD is to use xargs + stat + awk:
xargs -0 stat -f '%z' | awk '
{ sum += $1 }END
{ print sum }'