[MDEV-18572] Thread executing DROP TABLE listed twice in SHOW ENGINE INNODB STATUS output Created: 2019-02-14 Updated: 2020-08-07 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.1.34 |
| Fix Version/s: | 10.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
I noticed today that a thread executing DROP TABLE is listed twice in SHOW ENGINE INNODB STATUS output. Notice that both of the following threads have OS thread handle 0x2bab6976b700:
0x2bab6976b700 is 48015208789760 in decimal, so we can see that the thread also held dict_sys->mutex and dict_operation_lock at the time:
Is the double listing an artifact of the ‘background DROP TABLE queue’ hack mentioned in the comments of |
| Comments |
| Comment by Marko Mäkelä [ 2019-07-23 ] |
|
By design, DDL operations use two transactions inside InnoDB. The second transaction is created for updating the InnoDB data dictionary. Deadlocks and lock waits are prevented by dict_operation_lock a.k.a. dict_sys.latch and by the fact that internal transactions that access the InnoDB dictionary tables are not allowed to access any other tables. Side note: This principle is being violated for the persistent statistics tables (mysql.innodb_table_stats and mysql.innodb_index_stats). The extra transactions will go away when we remove the InnoDB internal SQL parser and the InnoDB internal data dictionary tables. |