Details
-
Task
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
Description
The way how InnoDB writes undo log about CREATE TABLE and DROP TABLE introduces the limitation that only one table may be created or dropped within a transaction.
We should replace the current mechanism (around trx->table_id) and introduce new undo log records for the following:
- delete-if-exists a file on rollback (when rolling back CREATE TABLE)
- delete-if-exists a file on purge (after DROP TABLE has been committed)
Applying either operation must write MLOG_FILE_DELETE2 to the redo log before actually deleting any files.
To avoid name clashes between DROP TABLE and subsequent CREATE TABLE by the same name (before the old files were purged), we should probably rename the files to temporary names before dropping. Also the rename operation must be undo logged and redo logged. Furthermore, during normal operation we could delete the files for the dropped table. The deletion by the purge subsystem would only be a fall-back measure for crash recovery.
Attachments
Issue Links
- blocks
-
MDEV-17581 Data dictionary
- Open
-
MDEV-25506 Atomic DDL: .frm file is removed and orphan InnoDB tablespace is left behind upon crash recovery
- Closed
- is blocked by
-
MDEV-24589 DROP TABLE is not crash-safe
- Closed
- relates to
-
MDEV-18867 Long Time to Stop and Start
- Closed
-
MDEV-24569 Assertion `mach_read_from_4(frame + 4U) == block.page.id().page_no()' failed in log_phys_t::apply
- Closed
-
MDEV-24589 DROP TABLE is not crash-safe
- Closed
-
MDEV-34789 Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, db.str, table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks on DROP TABLE, including via scripts/mariadb-install-db
- Closed
-
MDEV-8069 DROP or rebuild of a large table may lock up InnoDB
- Closed
-
MDEV-14398 When innodb_encryption_rotate_key_age=0 is set, server won't encrypt tablespaces
- Closed
-
MDEV-17567 Atomic DDL
- Closed