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

Verify encryption version when opening tables to avoid changing encryption version

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • Not 8.0.x, 2.4.20
    • 2.4.21
    • None
    • None
    • Yes
    • Yes

    Description

      Initialize MS5.7.30 database and start with encryption options

      /home/vagrant/MS_5_7_30_glibc2/bin/mysqld --no-defaults --core-file --basedir=/home/vagrant/MS_5_7_30_glibc2 --tmpdir=/home/vagrant/MS_5_7_30_glibc2/data --datadir=/home/vagrant/MS_5_7_30_glibc2/data --socket=/home/vagrant/MS_5_7_30_glibc2/socket.sock --port=19724 --log-error=/home/vagrant/MS_5_7_30_glibc2/log/master.err --server-id=100 --log-bin=binlog --early-plugin-load=keyring_file.so --keyring_file_data=/home/vagrant/MS_5_7_30_glibc2/keyring --log-slave-updates --gtid-mode=ON --enforce-gtid-consistency --binlog-format=row --master_verify_checksum=ON --binlog_checksum=CRC32

      Create 10 encrypted tables and add data in the tables
      Change the row format of a table

      ( for ((i=1; i<=10; i++)); do        
      /home/vagrant/MS_5_7_30_glibc2/bin/mysql -uroot -S/home/vagrant/MS_5_7_30_glibc2/socket.sock -e "ALTER TABLE test.sbtest2 ROW_FORMAT=COMPRESSED;" >/dev/null 2>&1        /home/vagrant/MS_5_7_30_glibc2/bin/mysql -uroot -S/home/vagrant/MS_5_7_30_glibc2/socket.sock -e "ALTER TABLE test.sbtest2 ROW_FORMAT=DYNAMIC;" >/dev/null 2>&1        /home/vagrant/MS_5_7_30_glibc2/bin/mysql -uroot -S/home/vagrant/MS_5_7_30_glibc2/socket.sock -e "ALTER TABLE test.sbtest2 ROW_FORMAT=COMPACT;" >/dev/null 2>&1        /home/vagrant/MS_5_7_30_glibc2/bin/mysql -uroot -S/home/vagrant/MS_5_7_30_glibc2/socket.sock -e "ALTER TABLE test.sbtest2 ROW_FORMAT=REDUNDANT;" >/dev/null 2>&1    
      done ) &

      Take full backup with lock-ddl-per-table

      /home/vagrant/pxb_2_4_20_x86_64/bin/xtrabackup --user=root --password= --backup --target-dir=/home/vagrant/dbbackup_26_06_2020/full -S /home/vagrant/MS_5_7_30_glibc2/socket.sock --datadir=/home/vagrant/MS_5_7_30_glibc2/data --keyring_file_data=/home/vagrant/MS_5_7_30_glibc2/keyring --xtrabackup-plugin-dir=/home/vagrant/pxb_2_4_20_x86_64/lib/plugin --lock-ddl-per-table

      Full backup fails with the error

      InnoDB: Encryption information in datafile: ./test/sbtest2.ibd can't be decrypted, please check if a keyring plugin is loaded and initialized successfully.
      InnoDB: Encryption information in datafile: ./test/#sql-ib50-1740587598.ibd can't be decrypted, please check if a keyring plugin is loaded and initialized successfully.

      If the full backup is successful, then the incremental backup fails.
      Run a small load

      sysbench /usr/share/sysbench/oltp_insert.lua --tables=10 --mysql-db=test --mysql-user=root --threads=50 --db-driver=mysql --mysql-socket=/home/vagrant/MS_5_7_30_glibc2/socket.sock --time=20 run >/dev/null 2>&1 &
      sleep 10

      Take incremental backup with lock-ddl-per-table

      /home/vagrant/pxb_2_4_20_x86_64/bin/xtrabackup --user=root --password= --backup --target-dir=/home/vagrant/dbbackup_26_06_2020/inc --incremental-basedir=/home/vagrant/dbbackup_26_06_2020/full -S /home/vagrant/MS_5_7_30_glibc2/socket.sock --datadir=/home/vagrant/MS_5_7_30_glibc2/data --keyring_file_data=/home/vagrant/MS_5_7_30_glibc2/keyring --xtrabackup-plugin-dir=/home/vagrant/pxb_2_4_20_x86_64/bin/lib/plugin --lock-ddl-per-table

      Incremental backup fails with the error

      InnoDB: Encryption information in datafile: ./test/sbtest2.ibd can't be decrypted, please check if a keyring plugin is loaded and initialized successfully.
      InnoDB: Encryption information in datafile: ./test/#sql-ib59-3804508607.ibd can't be decrypted, please check if a keyring plugin is loaded and initialized successfully.

      Logs attached from two consecutive runs:
      1. Full backup failed - full_backup_26_06_2020_41_log
      2. Incremental backup failed - full_backup_26_06_2020_25_log, inc_backup_26_06_2020_25_log

      Note: Issue observed on Ubuntu 20 and is reproducible everytime.

      Attachments

        Issue Links

          Activity

            People

              marcelo.altmann Marcelo Altmann
              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 - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1 week, 3 days, 30 minutes
                  1w 3d 30m

                  Smart Checklist