[MDEV-13818] CREATE INDEX leaks memory if running out of undo log space Created: 2017-09-15 Updated: 2019-03-08 Resolved: 2019-03-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.0, 10.1, 10.2, 10.3 |
| Fix Version/s: | 10.2.23, 10.1.39, 10.3.14, 10.4.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | ddl, online-ddl | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.3.6-1 | ||||||||
| Description |
|
The test innodb.alter_crash fails due to a memory leak.
The leak occurs when row_merge_create_index_graph() returns an error to row_merge_create_index(). The injected error is triggered when a SYS_INDEXES record is about to be inserted for the created index. The error cannot be reproduced on MariaDB 10.0 or 10.1. A possible reason is that the code may have been refactored in WL#6501 TRUNCATE TABLE in MySQL 5.7. |
| Comments |
| Comment by Thirunarayanan Balathandayuthapani [ 2018-02-28 ] |
|
Memory leaks happens during addition of index in alter table. Three operations happens in row_merge_create_index in 10.2 or create_dict_index (10.3) (1) Insert the index entry in SYS_INDEXES system table. Between (2) and (3), InnoDB adds the index into table cache. It checks whether If any error happens during (1) and (2) then InnoDB doesn't free the heap memory |
| Comment by Marko Mäkelä [ 2019-03-07 ] |
|
The memory leak is present also in MariaDB 10.0 and 10.1, possibly also 5.5. The test innodb.alter_crash was missing from 10.0 and 10.1. I ported it to 10.1 and plugged the memory leak in 10.1.39. |