Skip to content

Commit 549e84b

Browse files
committed
MDEV-30047 innodb.insert_into_empty fails to delete bulk_store
InnoDB fails to remove bulk store when InnoDB bulk insert does partial rollback on multiple tables. This memory leak was revealed by a test case that was added in commit 505da21 (MDEV-27214). trx_t::bulk_rollback(): Delete the bulk_store. After this function finishes execution, trx_t::is_bulk_insert() will not hold and therefore trx_t::commit_cleanup() will not free the memory. Alternatively, we could define trx_mod_table_time_t::~trx_mod_table_time_t() { delete bulk_store; } but that would likely introduce a performance regression for the common transaction commit. Bulk insert is rarely used. This fix was developed by Thirunarayanan Balathandayuthapani.
1 parent d533208 commit 549e84b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

storage/innobase/include/trx0trx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,7 @@ struct trx_t : ilist_node<>
11811181
continue;
11821182
if (t.second.get_first() < low_limit)
11831183
low_limit= t.second.get_first();
1184+
delete t.second.bulk_store;
11841185
}
11851186

11861187
trx_savept_t bulk_save{low_limit};

0 commit comments

Comments
 (0)