[MDEV-22456] Dropping the adaptive hash index may cause DDL to lock up InnoDB Created: 2020-05-04 Updated: 2023-12-28 Resolved: 2020-05-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.5.4, 10.2.33, 10.3.24, 10.4.14 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | performance | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
If the InnoDB buffer pool contains many pages for a table or index that is being dropped or rebuilt, and if many of such pages are pointed to by the adaptive hash index, dropping the adaptive hash index may consume a lot of time. The time-consuming operation of dropping the adaptive hash index entries is being executed while the InnoDB data dictionary cache dict_sys is exclusively locked. (Data file deletion also takes place while the dictionary cache is locked. That is being covered by It is not actually necessary to drop all entries from the adaptive hash index when a table or index is being dropped or rebuilt. We can let the LRU replacement policy of the buffer pool take care of this gradually. For this to work, we must detach the dict_table_t and dict_index_t objects from the main dict_sys cache, and once the last adaptive hash index entry for the detached table is removed (when the garbage page is evicted from the buffer pool) we can free the dict_table_t and dict_index_t object. Related to this, in |
| Comments |
| Comment by Marko Mäkelä [ 2020-05-11 ] | |||
|
For deferred dropping of adaptive hash index entries pointing to indexed virtual columns, we must clone the dict_table_t object. | |||
| Comment by Marko Mäkelä [ 2020-05-14 ] | |||
|
Please review bb-10.2-marko. My local tests were fine, but mleich reported some assertion failures for an earlier revision. | |||
| Comment by Matthias Leich [ 2020-05-15 ] | |||
|
|