[MDEV-15211] Mariabackups give "table 'X' doesn't exist in engine" when restoring backup Created: 2018-02-05 Updated: 2018-03-15 Resolved: 2018-03-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Backup |
| Affects Version/s: | 10.1 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Stefan Midjich | Assignee: | Zdravelina Sokolovska (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | innodb, mariabackup, need_feedback | ||
| Environment: |
CentOS 7 |
||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
Short description; I restore a mariabackup base backup (or one with incrementals applied) and in any case the restored backup is missing innodb data because I cannot dump tables and I cannot run show create table because I get an error that says "Table 'X' doesn't exist in engine". I've repeated the issue just for this bug report. I start with one base backup that finished without errors and says backup_type = full-backuped in /var/database/base_xtrabackup/xtrabackup_checkpoints. I empty /var/database/restored_xtrabackup and /var/database/mysql dirs. I run rsync -a /var/database/base_xtrabackup/* /var/database/restored_xtrabackup/ as root. I run mariabackup --prepare --target-dir=/var/database/restored_xtrabackup as root. See prepare.out.log in attachments for errors regarding one specific table. More about that below. I run mariabackup --copy-back --target-dir=/var/database/restored_xtrabackup as root. No errors in output. I then have a mariadb setup on this backup server only for restoring purposes, and I start it without issue. At this point I'm able to connect to the mysql console and list database, select databases. But if I try to run show create table on any table I get this error. ERROR 1932 (42S02): Table 'X' doesn't exist in engine If I run mysqldump with lock tables the error is; mysqldump: Got error: 1932: "Table 'X' doesn't exist in engine" when using LOCK TABLES Without lock tables it just skips the last part of the error. Noteworthy is that there is some corrpution in the live database. Mysqldump will only work from the live DB node if I use --ignore-table=dbname.mdl_tag_correlation which is en empty table but if I try to dump that empty table mysqldump fails when it reaches that table. I cannot try a test dump now because it would halt production but tomorrow I can add more info about how it fails and what is logged server side. I'll have to plan a service window to delete and re-create that table. |
| Comments |
| Comment by Marko Mäkelä [ 2018-02-05 ] | ||||
|
stemid, was there a file novo_hermods_se/mdl_tag_correlation.ibd in the backup? Was this table renamed recently? Or is this the very table that was corrupted? | ||||
| Comment by Zdravelina Sokolovska (Inactive) [ 2018-02-05 ] | ||||
|
stemid what's the datadir where your table X returned show create table X ? | ||||
| Comment by Zdravelina Sokolovska (Inactive) [ 2018-02-05 ] | ||||
|
stemidneed feedback | ||||
| Comment by Stefan Midjich [ 2018-02-05 ] | ||||
|
marko yes that file exists and it's brought along from the base_xtrabackup dir, to restored_xtrabackup and the datadir. As far as I know the table has not been renamed. It's not even used. Based on it not being used I assume it's been dormant for many years. The only major change, and what might have caused this issue, is when we went from mysql 5.5 to mariadb 10 by setting up a replication slave that replicated all data from the old 5.5 system to the new 10.1 cluster. Before that mysqldumps worked from the old system and did not halt at this table. Would you advise just dropping it and re-creating it? Ensuring all ibd files are deleted when it's dropped. winstone The datadir is specified in the environment part /var/database/mysql. I'm using rsync only to copy the base backup because I don't want to make changes to the original base backup. Does mariabackup have an alternative for this step? | ||||
| Comment by Zdravelina Sokolovska (Inactive) [ 2018-02-06 ] | ||||
|
marko
stemid Did you perform mysql_upgrade --verbose --verbose other-options ? | ||||
| Comment by Stefan Midjich [ 2018-02-06 ] | ||||
|
winstone I've never run mysql_upgrade before but I tried that now on a running instance of mysqld using the restored datafiles from the backup. Attached is the output. It seems to complain about tables not existing in engine for more than just my DB but also the mysql DB. And no a select won't work either, same error; "1932 ... Table 'X' doesn't exist in engine". | ||||
| Comment by Zdravelina Sokolovska (Inactive) [ 2018-02-07 ] | ||||
|
stemid I succeed to recreate the issue by changing the group owner of the files of one table X in datadir | ||||
| Comment by Marko Mäkelä [ 2018-03-15 ] | ||||
|
In the mysql_upgrade.out.log One more idea is that before winstone, Mariabackup 10.2 is only compatible with MariaDB 10.2. (Mariabackup 10.3 should work with 10.2 and 10.3.) The main reason for this is that MariaDB 10.2 broke redo log format compatibility with older versions, just like MySQL 5.7 that it is based on did. Older versions also did not have a redo log format version tag. Furthermore, Mariabackup 10.2 use a slightly different metadata file format (some fields have been removed). This should explain the error "This target does not have correct metadata". |