Skip to content

Commit

Permalink
MDEV-30047 innodb.insert_into_empty fails to delete bulk_store
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Nov 21, 2022
1 parent d533208 commit 549e84b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions storage/innobase/include/trx0trx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ struct trx_t : ilist_node<>
continue;
if (t.second.get_first() < low_limit)
low_limit= t.second.get_first();
delete t.second.bulk_store;
}

trx_savept_t bulk_save{low_limit};
Expand Down

0 comments on commit 549e84b

Please sign in to comment.