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

Correct corruption when redo logs are encrypted using xtrabackup --backup --compress=lz4

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 8.0.10
    • 8.0.13
    • None

    Description

      Initialize and start PS8.0.19-10 with encryption options

      /home/mchawla/PS130320_8_0_19_10_debug/bin/mysqld --no-defaults --core-file --basedir=/home/mchawla/PS130320_8_0_19_10_debug --tmpdir=/home/mchawla/PS130320_8_0_19_10_debug/data --datadir=/home/mchawla/PS130320_8_0_19_10_debug/data --socket=/home/mchawla/PS130320_8_0_19_10_debug/socket.sock --port=10270 --log-error=/home/mchawla/PS130320_8_0_19_10_debug/log/master.err --early-plugin-load=keyring_file.so --keyring_file_data=/home/mchawla/PS130320_8_0_19_10_debug/keyring --log-bin=binlog --binlog-encryption --innodb-undo-log-encrypt --innodb-redo-log-encrypt --default-table-encryption=ON --innodb_encrypt_online_alter_logs=ON --innodb_temp_tablespace_encrypt=ON --log-slave-updates --gtid-mode=ON --enforce-gtid-consistency --binlog-format=row --master_verify_checksum=ON --binlog_checksum=CRC32 --encrypt-tmp-files --innodb_sys_tablespace_encrypt --innodb_parallel_dblwr_encrypt --binlog-rotate-encryption-master-key-at-startup --table-encryption-privilege-check=ON --innodb-default-encryption-key-id=4294967295

      Create sysbench data with 10 tables.
      Run a sysbench load

      sysbench /usr/share/sysbench/oltp_insert.lua --tables=10 --mysql-db=test --mysql-user=root --threads=100 --db-driver=mysql --mysql-socket=${PWD}/socket.sock --time=50 --report-interval=1 run

      Take full backup with streaming, encryption and lz4 compression

      ./xtrabackup --user=root --password='' --backup --target-dir=$HOME/dbbackup_PS8/full -S $HOME/PS130320_8_0_19_10_debug/socket.sock --datadir=$HOME/PS130320_8_0_19_10_debug/data --keyring_file_data=$HOME/PS130320_8_0_19_10_debug/keyring --xtrabackup-plugin-dir=$HOME/pxb_8_0_11_debug/lib/plugin --transition-key=secret_key --history=PXB_default --encrypt=AES256 --encrypt-key=mHU3Zs5sRcSB7zBAJP1BInPP5lgShKly --encrypt-threads=10 --encrypt-chunk-size=128K --compress=lz4 --compress-threads=10 --stream=xbstream > $HOME/dbbackup_PS8/fullbackup.xbstream

      Extract, decrypt and decompress the full backup

      ./xbstream --directory=$HOME/dbbackup_PS8/full --extract --verbose --decrypt=AES256 --encrypt-key=mHU3Zs5sRcSB7zBAJP1BInPP5lgShKly --decompress --decompress-threads=10 < $HOME/dbbackup_PS8/fullbackup.xbstream

      The decompress fails with the following error:

      xtrabackup_logfile.lz4.xbcrypt
      decompress: compressed block size exceeds maximum block size.
      decrypt: write to destination failed.
      ./xbstream: my_write() failed.
      exit code: 1

      If the backup is extracted, decrypted and decompressed separately, the decompress still fails for xtrabackup_logfile file with the following error:

      200410 10:35:18 [01] decompressing ./xtrabackup_logfile.lz4
      Error 66 : Decompression error : ERROR_GENERIC
      cat: write error: Broken pipe
      Error: decrypt and decompress thread 0 failed.

      Note: The issue does not come with quicklz decompression.

      Logs attached.

      Attachments

        Issue Links

          Activity

            People

              rahul.malik Rahul Malik (Inactive)
              manish.chawla Manish Chawla
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 3 hours
                  1d 3h

                  Smart Checklist