Bug #36480 Backup: restore fails with changed Falcon tablespace
Submitted: 2 May 2008 20:56 Modified: 5 Sep 2008 17:35
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:6.0.6-alpha-debug OS:Linux (SUSE 10 | 32-bit)
Assigned to: Paul DuBois CPU Architecture:Any

[2 May 2008 20:56] Peter Gulutzan
Description:
I create a Falcon table with a tablespace.
I backup.
i drop the tablespace and create it again with a new datafile.
I try to restore.
The restore fails.

How to repeat:
CREATE DATABASE d1;
CREATE DATABASE d2;
CREATE TABLESPACE a ADD DATAFILE 'x' ENGINE=FALCON;
CREATE TABLE d1.t (s1 INT) ENGINE=FALCON TABLESPACE a;
BACKUP DATABASE d1 TO '1';
SHOW WARNINGS;
DROP TABLE d1.t;
DROP TABLESPACE a ENGINE=FALCON;
CREATE TABLESPACE a ADD DATAFILE 'y' ENGINE=FALCON;
CREATE TABLE d1.t (s1 CHAR) ENGINE=FALCON TABLESPACE a;
CREATE TABLE d2.t (s1 INT) ENGINE=FALCON TABLESPACE a;
RESTORE FROM '1';

The RESTORE will cause an error.
mysql> RESTORE FROM '1';
ERROR 1672 (HY000): Tablespace `a` needed by tables being
restored has changed on the server.
The original definition of the required tablespace is
'CREATE TABLESPACE `a` ADD DATAFILE 'x' ENGINE=FALCON'
while the same tablespace is defined on the server as
'CREATE TABLESPACE `a` ADD DATAFILE 'y
[4 May 2008 18:38] MySQL Verification Team
Thank you for the bug report.

miguel@hegel:~/dbs> 6.0b/bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.0.6-alpha-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE d1;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE DATABASE d2;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE TABLESPACE a ADD DATAFILE 'x' ENGINE=FALCON;
Query OK, 0 rows affected (0.22 sec)

mysql> CREATE TABLE d1.t (s1 INT) ENGINE=FALCON TABLESPACE a;
Query OK, 0 rows affected (0.06 sec)

mysql> BACKUP DATABASE d1 TO '1';
+-----------+
| backup_id |
+-----------+
| 1         | 
+-----------+
1 row in set (0.07 sec)

mysql> SHOW WARNINGS;
Empty set (0.00 sec)

mysql> DROP TABLE d1.t;
Query OK, 0 rows affected (0.00 sec)

mysql> DROP TABLESPACE a ENGINE=FALCON;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLESPACE a ADD DATAFILE 'y' ENGINE=FALCON;
Query OK, 0 rows affected (0.26 sec)

mysql> CREATE TABLE d1.t (s1 CHAR) ENGINE=FALCON TABLESPACE a;
Query OK, 0 rows affected (0.06 sec)

mysql> CREATE TABLE d2.t (s1 INT) ENGINE=FALCON TABLESPACE a;
Query OK, 0 rows affected (0.07 sec)

mysql> RESTORE FROM '1';
ERROR 1714 (HY000): Tablespace `a` needed by tables being restored has changed on the server. The original definition of the required tablespace is 'CREATE TABLESPACE `a` ADD DATAFILE 'x' ENGINE=FALCON' while the same tablespace is defined on the server as 'CREATE TABLESPACE `a` ADD DATAFILE 'y
mysql>
[21 May 2008 15:40] Lars Thalmann
This is how it is designed.  The table space needs to be identically 
defined in the backup image and on the restore server for Falcon 
backup/restore to work.

Docs, please ensure this is well document and then close as "not a bug".
[5 Sep 2008 17:35] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Added to http://dev.mysql.com/doc/refman/6.0/en/backup-database-restore-restrictions.html:

Falcon tablespaces must not change characteristics between BACKUP
DATABASE and RESTORE. A restore of databases containing tables in a
modified tablespace will fail. Suppose that you back up a database
containing a Falcon table. If you modify the tablespace
characteristics, or drop or lose and then re-create it with
characteristics not the same as originally, restoration of the
database will fail.