Uploaded image for project: 'Percona XtraBackup'
  1. Percona XtraBackup
  2. PXB-2614

xbstream sparse files support doesn't work on XFS

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 8.0.26-18 (Q3 2021)
    • 8.0.27-19 (Q4 2021)
    • None
    • None
    • Yes
    • Yes

    Description

      Steps to reproduce:

       

      Preparing compressed table
      mysql> CREATE TABLE a( id int primary key auto_increment, a varchar(100), b varchar(100), c blob) COMPRESSION='zlib';
      mysql> INSERT INTO a SET a = now(), b=now(), c=repeat(now(),3000);
      mysql> INSERT INTO a (a,b,c) SELECT a,b,c FROM a;
      …
      mysql> INSERT INTO a (a,b,c) SELECT a,b,c FROM a; 

       

      Taking a backup
      # xtrabackup --backup --stream=xbstream > a.xbs

       After extracting:

      Extracting xbstream's output file
      xbstream -x <a.xbs 

       

      sparse files work fine on EXT4, but not on XFS.

       

      XFS
      [email protected]:/tmp/xfs/test# du -sh a.ibd
      520M    a.ibd
      [email protected]:/tmp/xfs/test# du -sh --apparent-size a.ibd
      520M    a.ibd

       

      EXT4
      [email protected]:/tmp/a/test# du  -sh a.ibd
      136M    a.ibd
      [email protected]:/tmp/a/test# du -sh --apparent-size a.ibd
      520M    a.ibd

       

      `xtrabackup --copy-back` from XFS to EXT4 makes the file sparse again.

      Potential workarounds:

      • fallocate -d file.ibd 
      • cp --sparse
      • rsync --prealocate --sparse

       

      Attachments

        Activity

          People

            marcelo.altmann Marcelo Altmann
            iwo.panowicz Iwo Panowicz
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 1 week, 2 days, 45 minutes
                1w 2d 45m

                Smart Checklist