summaryrefslogtreecommitdiff
path: root/storage/innobase/trx
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-09-28 18:41:00 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-09-28 18:41:00 +0530
commit7d4b2b984779e695d0c233d11173b2965d25ef27 (patch)
tree8721f6f33f1b2c9a791abacc1b86de7ccc063f3b /storage/innobase/trx
parent7c7ac6d4a4c77d4c302732da2efe6785b1f0e455 (diff)
downloadmariadb-git-7d4b2b984779e695d0c233d11173b2965d25ef27.tar.gz
MDEV-29570 InnoDB fails to clean bulk buffer when server does rollback operation
- During bulk insert, server detects the error and does rollback operation. At that time, InnoDB fails to clean up the bulk insert buffer trx_t::rollback_finish(): Removed the clean up of modified tables from transaction trx_t::commit_cleanup(): Free the bulk buffer for bulk insert operation trx_t::commit(): Check whether modified table wasn't dropped only for non-dictionary transaction
Diffstat (limited to 'storage/innobase/trx')
-rw-r--r--storage/innobase/trx/trx0roll.cc1
-rw-r--r--storage/innobase/trx/trx0trx.cc9
2 files changed, 8 insertions, 2 deletions
diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc
index 59c9a319330..45dc78b4440 100644
--- a/storage/innobase/trx/trx0roll.cc
+++ b/storage/innobase/trx/trx0roll.cc
@@ -59,7 +59,6 @@ const trx_t* trx_roll_crash_recv_trx;
@retval false if the rollback was aborted by shutdown */
inline bool trx_t::rollback_finish()
{
- mod_tables.clear();
apply_online_log= false;
if (UNIV_LIKELY(error_state == DB_SUCCESS))
{
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 1ce81ebcb1c..89abf678699 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1388,6 +1388,10 @@ void trx_t::commit_cleanup()
ut_ad(!dict_operation);
ut_ad(!was_dict_operation);
+ if (is_bulk_insert())
+ for (auto &t : mod_tables)
+ delete t.second.bulk_store;
+
mutex.wr_lock();
state= TRX_STATE_NOT_STARTED;
mod_tables.clear();
@@ -1479,8 +1483,11 @@ void trx_t::commit()
ut_d(was_dict_operation= dict_operation);
dict_operation= false;
commit_persist();
+#ifdef UNIV_DEBUG
+ if (!was_dict_operation)
+ for (const auto &p : mod_tables) ut_ad(!p.second.is_dropped());
+#endif /* UNIV_DEBUG */
ut_d(was_dict_operation= false);
- ut_d(for (const auto &p : mod_tables) ut_ad(!p.second.is_dropped()));
commit_cleanup();
}