Applying incremental backup cannot treat databases/tables created aftrer the previous backup

Bug #400490 reported by Yasufumi Kinoshita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Confirmed
Wishlist
Unassigned

Bug Description

This is reported by Keith Murphy:

Now the problem occurs when I prepare this incremental backup:

-bash-3.2$ xtrabackup --prepare --target-dir=/backups/full_backups --
incremental-dir=/backups/incremenatal_backup_one
xtrabackup Ver rc-0.7 for 5.0.83 unknown-linux-gnu (x86_64)
incremental backup from 0:372733003 is enabled.
xtrabackup: cd to /backups/full_backups
xtrabackup: This target seems to be already prepared.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(0
738789408)
Applying /backups/incremenatal_backup_one/ibdata1.delta ...
Applying /backups/incremenatal_backup_one/sakila/staff.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/
film_category.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/
customer.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/country.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/payment.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/film.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/
category.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/actor.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/address.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/rental.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/city.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/
inventory.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/
film_actor.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/store.ibd.delta ...
Applying /backups/incremenatal_backup_one/sakila/
language.ibd.delta ...
090713 13:33:24 InnoDB: Operating system error number 2 in a file
operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: error: cannot open /backups/full_backups/employees/
titles.ibd
xtrabackup: Error: xtrabackup_apply_delta() failed.
090713 13:33:24 InnoDB: Operating system error number 2 in a file
operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: error: cannot open /backups/full_backups/employees/
salaries.ibd
xtrabackup: Error: xtrabackup_apply_delta() failed.
090713 13:33:24 InnoDB: Operating system error number 2 in a file
operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: error: cannot open /backups/full_backups/employees/
employees.ibd
xtrabackup: Error: xtrabackup_apply_delta() failed.
090713 13:33:24 InnoDB: Operating system error number 2 in a file
operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: error: cannot open /backups/full_backups/employees/
dept_manager.ibd
xtrabackup: Error: xtrabackup_apply_delta() failed.
090713 13:33:24 InnoDB: Operating system error number 2 in a file
operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: error: cannot open /backups/full_backups/employees/
departments.ibd
xtrabackup: Error: xtrabackup_apply_delta() failed.
090713 13:33:24 InnoDB: Operating system error number 2 in a file
operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: error: cannot open /backups/full_backups/employees/
dept_emp.ibd
xtrabackup: Error: xtrabackup_apply_delta() failed.
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = /backups/
incremenatal_backup_one
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 2097152
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory
parameter)
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
090713 13:33:25 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
090713 13:33:25 InnoDB: Error: table 'employees/departments'
InnoDB: in InnoDB data dictionary has tablespace id 23,
InnoDB: but tablespace with that id or name does not exist. Have
InnoDB: you deleted or moved .ibd files?
InnoDB: This may also be a table created with CREATE TEMPORARY TABLE
InnoDB: whose .ibd and .frm files MySQL automatically removed, but the
InnoDB: table still exists in the InnoDB internal data dictionary.
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
InnoDB: for how to resolve the issue.
090713 13:33:25 InnoDB: Error: table 'employees/dept_emp'
InnoDB: in InnoDB data dictionary has tablespace id 25,
InnoDB: but tablespace with that id or name does not exist. Have
InnoDB: you deleted or moved .ibd files?
InnoDB: This may also be a table created with CREATE TEMPORARY TABLE
InnoDB: whose .ibd and .frm files MySQL automatically removed, but the
InnoDB: table still exists in the InnoDB internal data dictionary.
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
InnoDB: for how to resolve the issue.
090713 13:33:25 InnoDB: Error: table 'employees/dept_manager'
InnoDB: in InnoDB data dictionary has tablespace id 24,
InnoDB: but tablespace with that id or name does not exist. Have
InnoDB: you deleted or moved .ibd files?
InnoDB: This may also be a table created with CREATE TEMPORARY TABLE
InnoDB: whose .ibd and .frm files MySQL automatically removed, but the
InnoDB: table still exists in the InnoDB internal data dictionary.
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
InnoDB: for how to resolve the issue.
090713 13:33:25 InnoDB: Error: table 'employees/employees'
InnoDB: in InnoDB data dictionary has tablespace id 22,
InnoDB: but tablespace with that id or name does not exist. Have
InnoDB: you deleted or moved .ibd files?
InnoDB: This may also be a table created with CREATE TEMPORARY TABLE
InnoDB: whose .ibd and .frm files MySQL automatically removed, but the
InnoDB: table still exists in the InnoDB internal data dictionary.
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
InnoDB: for how to resolve the issue.
090713 13:33:25 InnoDB: Error: table 'employees/salaries'
InnoDB: in InnoDB data dictionary has tablespace id 27,
InnoDB: but tablespace with that id or name does not exist. Have
InnoDB: you deleted or moved .ibd files?
InnoDB: This may also be a table created with CREATE TEMPORARY TABLE
InnoDB: whose .ibd and .frm files MySQL automatically removed, but the
InnoDB: table still exists in the InnoDB internal data dictionary.
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
InnoDB: for how to resolve the issue.
090713 13:33:25 InnoDB: Error: table 'employees/titles'
InnoDB: in InnoDB data dictionary has tablespace id 26,
InnoDB: but tablespace with that id or name does not exist. Have
InnoDB: you deleted or moved .ibd files?
InnoDB: This may also be a table created with CREATE TEMPORARY TABLE
InnoDB: whose .ibd and .frm files MySQL automatically removed, but the
InnoDB: table still exists in the InnoDB internal data dictionary.
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html
InnoDB: for how to resolve the issue.
InnoDB: Last MySQL binlog file position 0 340049538, file name ./mysql-
bin.000003
090713 13:33:25 InnoDB: Started; log sequence number 0 738789408

[notice (again)]
  If you use binary log and don't use any hack of group commit,
  the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 340049538, file name ./mysql-
bin.000003

xtrabackup: starting shutdown with innodb_fast_shutdown = 1
090713 13:33:25 InnoDB: Starting shutdown...
090713 13:33:26 InnoDB: Shutdown completed; log sequence number 0
738789408

So any ideas on what is going on?

From the error messages it seems that the incremental restore is
stopping because it doesn't see the "structure" of the employee
database in the full backup. Well, it wouldn't see it because it isn't
there. The employee database was loaded after the full backup was
taking..it essentially was what changed between the two backups. So of
course it isn't going on find it.

Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

XtraBackup should create dirs/files when they are not found.

Changed in percona-xtrabackup:
assignee: nobody → Yasufumi Kinoshita (yasufumi-kinoshita)
status: New → Confirmed
Revision history for this message
ramk (ramk) wrote :

Is there a workaround for this issue? If I have a copy of the frm file and the ibd.delta file from the incremental backup can I restore manually?

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

Incremental mode does not support changes in schema. Put in "Wishlist"

Changed in percona-xtrabackup:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.