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

LP #1022562: Inc backup fails if a tablespace is created between full and inc backups

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      **Reported in Launchpad by Laurynas Biveinis last update 30-08-2012 11:11:37

      If the xb_incremental_compressed test is extended to create a new table between the full and inc backups and insert some rows to it (did not check if inserting the rows is actually mandatory), then the 2nd prepare step will show an error:

      InnoDB: Reading tablespace information from the .ibd files...
      InnoDB: Error: tablespace id 18446744073709551615 in file ./incremental_sample/t2.ibd is not sensible
      120709 16:07:22 InnoDB: Error creating file './incremental_sample/t2.ibd'.
      120709 16:07:22 InnoDB: Operating system error number 17 in a file operation.
      InnoDB: Error number 17 means 'File exists'.

      This error will cascade to a same error message on the 3rd prepare step and then to a restored from backup server error:

      120709 16:07:30 [ERROR] Cannot find or open table incremental_sample/t2 from
      the internal data dictionary of InnoDB though the .frm file for the
      table exists. Maybe you have deleted and recreated InnoDB data
      files but have forgotten to delete the corresponding .frm files
      of InnoDB tables, or you have moved .frm files to another database?
      or, the table contains indexes that this version of the engine
      doesn't support.

      Tests xb_incremental and ib_incremental pass with the same change. Tested with xtradb51.

      The testcase changes:
      === modified file 'test/t/xb_incremental_compressed.sh'
      — test/t/xb_incremental_compressed.sh 2012-06-05 12:35:33 +0000
      +++ test/t/xb_incremental_compressed.sh 2012-07-09 13:07:00 +0000
      @@ -79,31 +79,45 @@

      vlog "Making changes to database"

      + ${MYSQL} ${MYSQL_ARGS} -e "CREATE TABLE t2 (a INT(11) DEFAULT NULL, \
      +number INT(11) DEFAULT NULL) ENGINE=INNODB \
      +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$page_size" incremental_sample
      +
      let "count=numrow+1"
      let "numrow=15000"
      while [ "$numrow" -gt "$count" ]; do

      • sql="INSERT INTO test VALUES ($count, $numrow)"
        + sql="VALUES ($count, $numrow)"
        let "count=count+1"
        for ((i=0; $i<99; i++)); do
        sql="${sql},($count, $numrow)"
        let "count=count+1"
        done
      • ${MYSQL} ${MYSQL_ARGS} -e "$sql" incremental_sample
        + ${MYSQL} ${MYSQL_ARGS} -e "INSERT INTO test $sql" incremental_sample
        + ${MYSQL} ${MYSQL_ARGS} -e "INSERT INTO t2 $sql" incremental_sample
        done

      rows=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT FROM test" \
      incremental_sample`
      if [ "$rows" != "15000" ]; then

      • vlog "Failed to add more rows"
        + vlog "Failed to add more rows to 'test'"
        exit -1
        fi

      + rows=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT FROM t2" \
      +incremental_sample`
      + if [ "$rows" != "5000" ]; then
      + vlog "Failed to add more rows to 't2'"
      + exit -1
      + fi
      +
      vlog "Changes done"

      1. Saving the checksum of original table
      • checksum_a=`checksum_table incremental_sample test`
        + checksum_test_a=`checksum_table incremental_sample test`
        + checksum_t2_a=`checksum_table incremental_sample t2`
      • vlog "Table checksum is $checksum_a"
        + vlog "Table 'test' checksum is $checksum_test_a"
        + vlog "Table 't2' checksum is $checksum_t2_a"

      vlog "Making incremental backup"

      @@ -127,8 +141,9 @@
      vlog "Data prepared for restore"

      1. removing rows
      • vlog "Table cleared"
        ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
        + ${MYSQL} ${MYSQL_ARGS} -e "delete from t2;" incremental_sample
        + vlog "Tables cleared"
      1. Restore backup

      @@ -144,12 +159,19 @@

      start_server ${mysqld_additional_args}

      • vlog "Cheking checksums"
      • checksum_b=`checksum_table incremental_sample test`
        -
      • if [ "$checksum_a" != "$checksum_b" ]
      • then
      • vlog "Checksums are not equal"
        + vlog "Checking checksums"
        + checksum_test_b=`checksum_table incremental_sample test`
        + checksum_t2_b=`checksum_table incremental_sample t2`
        +
        + if [ "$checksum_test_a" != "$checksum_test_b" ]
        + then
        + vlog "Checksums of table 'test' are not equal"
        + exit -1
        + fi
        +
        + if [ "$checksum_t2_a" != "$checksum_t2_b" ]
        + then
        + vlog "Checksums of table 't2' are not equal"
        exit -1
        fi

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lpjirasync lpjirasync (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: