Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34820

wsrep_sst_mariabackup get_footprint() portability and accuracy fix

    XMLWordPrintable

Details

    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 }

      '

      Attachments

        Activity

          People

            sysprg Julius Goryavsky
            bit0mike Mike Andrews
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.