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

mariadb-backup fails on database which was partially restored with mariadb-backup

    XMLWordPrintable

Details

    Description

      Szenario:

      1. Physical full backup with mariadb-backup (--backup)
      2. Prepare of this backup (--prepare)
      3. Prepare with export for partial physical restore (--prepare --export --database=test)
      4. DISCARD/cp/chown/IMPORT of tablespace
      Up to here everything is fine. NO DB restart is done.
      5. Physical full backup with mariadb-backup (--backup) again.

      *.ibd file is missing in backup:
      rw-rw--- 1 mysql mysql 65 Jun 18 17:33 /tmp/bck/daily/bck_full_2024-06-18/test/db.opt
      rw-rw--- 1 mysql mysql 1100 Jun 18 17:33 /tmp/bck/daily/bck_full_2024-06-18/test/test.frm

      and we get in mariadb-backup output the following message:

      ...
      [00] 2024-06-18 17:33:02 mariabackup: Generating a list of tablespaces
      [00] 2024-06-18 17:33:02 DDL tracking : delete 1595 "./test/test.ibd"
      ...
      [01] 2024-06-18 17:33:05 Warning: We assume the table was dropped during xtrabackup execution and ignore the tablespace ./test/test.ibd
      ...
      [00] 2024-06-18 17:33:20 Redo log (from LSN 52224057258 to 52224510260) was copied.
      [00] 2024-06-18 17:33:20 completed OK!

      That means, that this backup is broken now an cannot be used for future partial or full restore!!!

      Steps to reproduce:

      PORT=3321
      DATADIR=/home/mysql/database/mariadb-1011/data
      BACKUPNAME=bck_full_2024-06-18
      BACKUPDIR=/tmp/bck

      rm -rf ${BACKUPDIR}/daily/${BACKUPNAME}

      /home/mysql/product/mariadb-10.11/bin/mariabackup --user=brman --password=secret --host=127.0.0.1 --port=3321 --backup --target-dir=/tmp/bck/daily/bck_full_2024-06-18
      /home/mysql/product/mariadb-10.11/bin/mariabackup --user=brman --password=secret --host=127.0.0.1 --port=3321 --prepare --target-dir=/tmp/bck/daily/bck_full_2024-06-18
      /home/mysql/product/mariadb-10.11/bin/mariabackup --user=brman --host=127.0.0.1 --port=3321 --prepare --export --databases=test --target-dir=/tmp/bck/daily/bck_full_2024-06-18

      ALTER TABLE `test`.`test` DISCARD TABLESPACE;
      cp /tmp/bck/daily/bck_full_2024-06-18/test/test.cfg /home/mysql/database/mariadb-1011/data/test/test.cfg
      cp /tmp/bck/daily/bck_full_2024-06-18/test/test.ibd /home/mysql/database/mariadb-1011/data/test/test.ibd
      chown mysql: /home/mysql/database/mariadb-1011/data/test/test.cfg /home/mysql/database/mariadb-1011/data/test/test.ibd
      ALTER TABLE `test`.`test` IMPORT TABLESPACE;
      rm /home/mysql/database/mariadb-1011/data/test/test.cfg
      rm /tmp/bck/daily/bck_full_2024-06-18/test/test.cfg

      no restart

      /home/mysql/product/mariadb-10.11/bin/mariabackup --user=brman --password=secret --host=127.0.0.1 --port=3321 --backup --target-dir=/tmp/bck/daily/bck_full_2024-06-18

      Attachments

        Activity

          People

            vlad.lesin Vladislav Lesin
            oli Oli Sennhauser
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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