Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL)
-
None
Description
innodb.drop_table_background 'xtradb' w3 [ fail ]
|
Test ended at 2017-06-09 06:04:25
|
|
CURRENT_TEST: innodb.drop_table_background
|
mysqltest: At line 29: query 'CREATE TABLE t (a INT) ENGINE=InnoDB' failed: 1813: Tablespace for table '`test`.`t`' exists. Please DISCARD the tablespace before IMPORT.
|
|
The result from queries just before the failure was:
|
CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT,
|
KEY(c1), KEY(c2), KEY(c2,c1),
|
KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1),
|
KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1),
|
KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB;
|
SET DEBUG_DBUG='+d,row_drop_table_add_to_background';
|
DROP TABLE t;
|
CREATE TABLE t (a INT) ENGINE=InnoDB;
|
Note: The failure happened on the valgrind builder. Either because it's valgrind, or on some other reason, but the server didn't shutdown properly on restart before running the failed command – possibly it is the reason.
Attachments
Issue Links
- is part of
-
MDEV-14585 Automatically remove #sql- tables in innodb dictionary during recovery
-
- Closed
-
- relates to
-
MDEV-14378 In ALGORITHM=INPLACE, use a common name for the intermediate tables or partitions
-
- Closed
-
The background DROP TABLE queue is not persistent and thus not crash-safe.
I think that the likely explanation is that with Valgrind, the shutdown_server timeout was exceeded and the server process was killed before the DROP TABLE queue was persistently emptied. Or the test was run multiple times, and the process was killed before table t from the previous test was actually dropped.
A fix would be to rename the table to an intermediate name before adding it to the queue, and on server startup, drop the tables that match the intermediate name pattern. That is what I am going to do in bb-10.2-ext and 10.3. The intermediate name prefix that I am going to use is #sql-ib, which starting with
MDEV-14378is only used for InnoDB internal tables. In MariaDB 10.x beforeMDEV-14378, it can happen that during ALTER TABLE…ALGORITHM=INPLACE that is rebuilding the table, both copies of the table will temporarily carry a name that starts with #sql-ib.A more comprehensive fix would be to remove the background DROP TABLE queue and the concept of "DDL transactions" from InnoDB altogether. This would require replacing the dict_operation_lock with meta-data locks (MDL), also in internal InnoDB operations.