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

FLUSH TABLE t FOR EXPORT or ALTER TABLE t2 IMPORT TABLESPACE

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Duplicate
    • 8.0.26-18 (Q3 2021)
    • None
    • None
    • None

    Description

       
      How to repeat:

      1. Create a sandbox with dbdeployer.
        $ dbdeployer deploy single mysql_8.0.17
      1. Create a schema and a table.
      2. I am using many CHAR fields fo generate a big dataset quickly.
        $ ./use <<< "CREATE DATABASE test_jfg"
        $ ./use test_jfg <<< "
        CREATE TABLE test_jfg.t(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY);
        ALTER TABLE test_jfg.t ADD COLUMN v VARCHAR(255);"
        $ for i in $(seq 9); do
        ./use test_jfg <<< "ALTER TABLE test_jfg.t ADD COLUMN c$i CHAR(255) DEFAULT ''"
        done
      1. Generate ~2 GB of data in that table.
        $ seq -f "INSERT INTO t(v) VALUES ('%f');" 1 1000000 | sed -e '1~1000s/^/COMMIT;BEGIN;/' | ./use test_jfg
      1. Contrarily to
        Bug#96475
        , I will run all next steps manually to show things are broken.

      – In the mysql client, run FLUSH TABLE [...] FOR EXPORT.
      mysql [localhost:8017] {msandbox} (test_jfg) > FLUSH TABLE t FOR EXPORT;
      Query OK, 0 rows affected (0.00 sec)

      1. In bash, copy the files.
        $ for s in cfg ibd; do cp data/test_jfg/t{,_}.$s; done

      – In the . mysql client, UNLOCK TABLE and prepare import.
      mysql [localhost:8017] {msandbox} (test_jfg) > UNLOCK TABLES;
      Query OK, 0 rows affected (0.00 sec)

      mysql [localhost:8017] {msandbox} (test_jfg) > CREATE TABLE t2 LIKE t; ALTER TABLE t2 DISCARD TABLESPACE;
      Query OK, 0 rows affected (0.04 sec)

      Query OK, 0 rows affected (0.01 sec)

      1. In bash, copy the files.
        $ for s in cfg ibd; do cp data/test_jfg/t{_,2}.$s; done

      – In the mysql client, import the table.
      mysql [localhost:8017] {msandbox} (test_jfg) > ALTER TABLE t2 IMPORT TABLESPACE;
      ERROR 1817 (HY000): Index corrupt: Clustered index validation failed, due to data file corruption.

      – In above, we can see that things fail, but I would expect them to succeed.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              roberto.garciadebem Roberto Garcia de Bem
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist