Comment 0 for bug 901775

Revision history for this message
Alexey Kopytov (akopytov) wrote :

ALTER TABLE ... IMPORT TABLESPACE is holding the data dictionary mutex during the entire import operation.

This becomes a problem for innodb_expand_import, because that code scans the tablespace being imported, blocking all queries accessing any InnoDB tables during the scan. It does need to protect some data dictionary operations, but it is possible to release the mutex during the most expensive operation, i.e. the .ibd file scan.

The only problem with temporarily releasing the mutex is that changing the table's metadata while it's being imported may lead to data dictionary corruption. But in 5.1 any query trying to open that table will fail with an error, because InnoDB sets the ibd_file_missing file for the in-memory table object until import is complete. In 5.5 queries will block on the metadata lock set by ALTER TABLE. So the table's metadata is protected even without holding the data dictionary mutex.