Commit 8d770859 authored by Sergei Golubchik's avatar Sergei Golubchik

InnoDB purge thread and other bg threads

in slow shutdown mode stop all bg threads that might generate
new undo records to purge before stopping purge threads.
parent eabb0aef
......@@ -345,6 +345,11 @@ thd_destructor_proxy(void *)
while (trx_sys_any_active_transactions()) {
os_thread_sleep(1000);
}
/* Some background threads might generate undo pages that will
need to be purged, so they have to be shut down before purge
threads if slow shutdown is requested. */
srv_shutdown_bg_undo_sources();
}
srv_purge_wakeup();
......
......@@ -88,6 +88,11 @@ Shuts down the Innobase database.
dberr_t
innobase_shutdown_for_mysql(void);
/****************************************************************//**
Shuts down background threads that can generate undo pages. */
void
srv_shutdown_bg_undo_sources(void);
/********************************************************************
Signal all per-table background threads to shutdown, and wait for them to do
so. */
......
......@@ -2769,6 +2769,21 @@ srv_fts_close(void)
}
#endif
/****************************************************************//**
Shuts down background threads that can generate undo pages. */
void
srv_shutdown_bg_undo_sources(void)
/*===========================*/
{
fts_optimize_shutdown();
dict_stats_shutdown();
/* Shutdown key rotation threads */
fil_crypt_threads_end();
}
/****************************************************************//**
Shuts down the InnoDB database.
@return DB_SUCCESS or error code */
......@@ -2785,12 +2800,8 @@ innobase_shutdown_for_mysql(void)
return(DB_SUCCESS);
}
if (!srv_read_only_mode) {
fts_optimize_shutdown();
dict_stats_shutdown();
/* Shutdown key rotation threads */
fil_crypt_threads_end();
if (!srv_read_only_mode && srv_fast_shutdown) {
srv_shutdown_bg_undo_sources();
}
/* 1. Flush the buffer pool to disk, write the current lsn to
......
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