Possible bug :Data Loss with Full DB backup using XTRABACKUP ?

Asked by Ankit

Hi,

I am facing an issue while doing a Full DB Backup using XTRABACKUP, the backed up data goes corrupt during backup.

    Take a full backup of DB.

    While backup is going on fire table rename command from one database to another, for e.g.
                rename table xxx.sale_order to test.sale_order;
                rename table xxx..suborder to test.suborder;
    The full backup completes without any error

    When the full backup is prepared, following errors are encountered
        InnoDB: Last MySQL binlog file position 0 227287138, file name ./mysql-bin.000085
        130502 13:44:57 InnoDB: Error: table 'test/sale_order'
        InnoDB: in InnoDB data dictionary has tablespace id 6924,
        InnoDB: but tablespace with that id or name does not exist. It will be removed from data dictionary.
        130502 13:44:57 InnoDB: Error: table 'test/suborder'
        InnoDB: in InnoDB data dictionary has tablespace id 6929,
        InnoDB: but tablespace with that id or name does not exist. It will be removed from data dictionary.
        130502 13:44:57 InnoDB: Waiting for the background threads to start
        130502 13:44:58 Percona XtraDB (http://www.percona.com) 1.1.8-20.1 started; log sequence number 274420077960

    But I see that prepare was indeed successful
        xtrabackup: starting shutdown with innodb_fast_shutdown = 1
        130502 13:45:32 InnoDB: Starting shutdown...
        130502 13:45:36 InnoDB: Shutdown completed; log sequence number 274420091916
        130502 13:45:36 innobackupex: completed OK!

    MySQL comes up fine with this backup, but when I see the data directory of the database test, I do not see the *.ibd files for the tables which were renamed
        [ankit@TungstenPOC02 2013-05-02_12-50-02]$ cd test
        [ankit@TungstenPOC02 test]$ ls -ltr
        total 1076
        -rwxrwxr-x 1 ankit ankit 13975 May 2 11:23 suborder.frm
        -rwxrwxr-x 1 ankit ankit 13832 May 2 11:23 sale_order.frm
        -rwxrwxr-x 1 ankit ankit 13950 May 2 11:29 user.frm
        -rwxrwxr-x 1 ankit ankit 61 May 2 11:29 db.opt
        -rwxrwxr-x 1 ankit ankit 1048576 May 2 11:30 user.ibd

    On MySQL, the tables are shown to exist under test database but get following error when trying to query them
        mysql> use test;
        Reading table information for completion of table and column names
        You can turn off this feature to get a quicker startup with -A

        Database changed
        mysql> show tables;
        +----------------+
        | Tables_in_test |
        +----------------+
        | sale_order |
        | suborder |
        | user |
        +----------------+
        3 rows in set (0.01 sec)

        mysql> select * from sale_order;
        ERROR 1146 (42S02): Table 'test.sale_order' doesn't exist
        mysql> drop table sale_order;
        ERROR 1051 (42S02): Unknown table 'sale_order'

Question information

Revision history for this message
Alexey Kopytov (akopytov) said :
#1

It is a partial case of https://bugs.launchpad.net/percona-xtrabackup/+bug/1079700 i.e. the fix for that bug will also fix this one.

Can you help with this problem?

Provide an answer of your own, or ask Ankit for more information if necessary.

To post a message you must log in.