Commit 549e84b4 authored by Marko Mäkelä's avatar Marko Mäkelä

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 505da21e (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.
parent d5332086
......@@ -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};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment