[MDEV-25691] Simplify handlerton::drop_database for InnoDB Created: 2021-05-17 Updated: 2022-10-21 Resolved: 2021-05-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.6.1 |
| Type: | Task | Priority: | Blocker |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | performance | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
The implementation of handlerton::drop_database in InnoDB is unnecessarily complex. The minimal implementation should check that no conflicting locks or references exist on the tables, delete all table metadata in a single transaction, and finally delete the tablespaces. Note: DROP DATABASE will delete each individual table that the SQL layer knows about, one table per transaction. The handlerton::drop_database is basically a final cleanup step for removing any garbage that could have been left behind in InnoDB due to some bug, or not having Atomic DDL ( |
| Comments |
| Comment by Marko Mäkelä [ 2021-05-18 ] | |||||||||||||||||||||||||||||||||||||||||
|
As part of this fix, a function lock_release_on_rollback() was introduced to avoid heap-use-after-free on the rollback of native ALTER TABLE. That and related refactoring of dict_drop_index_tree() could be viewed as a follow-up fix of | |||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2021-05-21 ] | |||||||||||||||||||||||||||||||||||||||||
|
For a reference – test case and a failure (one of) that a postfix for this task has fixed.
Fixed by
|