diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cac438c71d817..42dce9d79b778 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -340,6 +340,12 @@ thd_destructor_proxy(void *) mysql_mutex_unlock(&thd_destructor_mutex); thd_destructor_myvar = NULL; + srv_fast_shutdown = (ulint) innobase_fast_shutdown; + if (srv_fast_shutdown == 0) { + while (trx_sys_any_active_transactions()) { + os_thread_sleep(1000); + } + } srv_purge_wakeup(); destroy_thd(thd); diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 2e9e3b7ea8ab0..efc33a9baa249 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -3073,6 +3073,12 @@ DECLARE_THREAD(srv_purge_coordinator_thread)( n_pages_purged = trx_purge(1, srv_purge_batch_size, false); } +#ifdef UNIV_DEBUG + if (srv_fast_shutdown == 0) { + trx_commit_disallowed = true; + } +#endif /* UNIV_DEBUG */ + /* This trx_purge is called to remove any undo records (added by background threads) after completion of the above loop. When srv_fast_shutdown != 0, a large batch size can cause significant