Cannot open filepath: ./mysql/innodb_table_stats.ibd which uses the same space ID

Error when backing up data using xtrabackup:

    xtrabackup version 2.4.4 based on MySQL server 5.7.13 Linux (x86_64) (revision id: df58cf2)
    xtrabackup: uses posix_fadvise().
    xtrabackup: cd to /var/lib/mysql
    xtrabackup: open files limit requested 0, set to 1048576
    xtrabackup: using the following InnoDB configuration:
    xtrabackup:   innodb_data_home_dir = .
    xtrabackup:   innodb_data_file_path = ibdata1:12M:autoextend
    xtrabackup:   innodb_log_group_home_dir = ./
    xtrabackup:   innodb_log_files_in_group = 2
    xtrabackup:   innodb_log_file_size = 50331648
    InnoDB: Number of pools: 1
    210526 06:54:33 >> log scanned up to (12736942)
    xtrabackup: Generating a list of tablespaces
    InnoDB: Allocated tablespace ID 4 for slave_master_info, old maximum was 0
    InnoDB: Attempted to open a previously opened tablespace. Previous tablespace innodb_table_stats at filepath: ./innodb_table_stats.ibd uses space ID: 1. Cannot open filepath: ./mysql/innodb_table_stats.ibd which uses the same space ID.

The tableinnodb_table_stats is normal, and the database can be exported normally with mysqldump.

mysql version is 5.7.13.

1 Like

Hi @thepoy. Welcome to the forums!

The MySQL and XtraBackup versions seem to be compatible, so I don’t think issues are stemming from them.

You may have some kind of corruption in that instance. From the error message:

    InnoDB: Attempted to open a previously opened tablespace. 
Previous tablespace innodb_table_stats at filepath: ./innodb_table_stats.ibd uses space ID: 1. 
Cannot open filepath: ./mysql/innodb_table_stats.ibd which uses the same space ID.

Note how the paths are different, even if the table name is the same. Have you checked the MySQL error logs for any potentially related errors? I’d also check dmesg -T and /var/log/messages (and/or /var/log/syslog) to check for hardware or I/O errors in the past.

It’s always recommended to search the bug database, too, a search like the following can help you:
site:jira.percona.com xtrabackup <other_keywords>

1 Like