Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
Description
InnoDB transaction rollback includes an unnecessary work-around for a data corruption bug that was fixed by me in MySQL 5.6.12. By acquiring and releasing dict_operation_lock in shared mode, row_undo() hopes to prevent the table from being dropped while the undo log record is being rolled back. But, thanks to the fix, the rollback is guaranteed to be protected by transactional locks (table IX lock, in addition to implicit or explicit exclusive locks on the records that had been modified).
In one test case for which I analyzed rr replay, this unnecessary contention on dict_operation_lock seems to slow down the rollback of a CREATE…SELECT statement. As mentioned in MDEV-21602, the error handling of CREATE…SELECT would internally invoke DROP TABLE before rolling back the changes, and that DROP TABLE would invoke another work-around in InnoDB, the background DROP TABLE queue. Because that background operation would periodically acquire dict_operation_lock in exclusive mode, it would seriously slow down any rollback operation.
While the root cause of the problem is to be addressed in MDEV-21602, unnecessary acquisitions of the known contention point dict_operation_lock should be removed. Another reason for such acquisitions is FOREIGN KEY operations, to be addressed in MDEV-21175.
Attachments
Issue Links
- blocks
-
MDEV-24258 Merge dict_sys.mutex into dict_sys.latch
- Closed
- causes
-
MDEV-23514 SEGV storage/innobase/row/row0log.cc:863 in row_log_table_low
- Closed
- is blocked by
-
MDEV-515 innodb bulk insert
- Closed
-
MDEV-23721 Assertion ‘node->table->is_temporary() || lock_table_has_locks(node->table)’ failed in row_undo_ins
- Closed
- relates to
-
MDEV-21175 Remove dict_table_t::n_foreign_key_checks_running from InnoDB
- Closed
-
MDEV-21602 CREATE TABLE…PRIMARY KEY…SELECT workaround causes DROP TABLE to ignore locks
- Closed
-
MDEV-24324 Having an active XA transaction in THD:cleanup will release MDL locks too early.
- Open
-
MDEV-25506 Atomic DDL: .frm file is removed and orphan InnoDB tablespace is left behind upon crash recovery
- Closed
-
MDEV-25919 InnoDB reports misleading lock wait timeout on DDL operations
- Closed