Commit 8d24bef6 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14080 InnoDB shutdown sometimes hangs

srv_purge_wakeup(): If thd_destructor_proxy has initiated the first
step of shutdown, ensure that all purge threads terminate.

logs_empty_and_mark_files_at_shutdown(): Add a debug assertion.
(The purge threads should have been shut down already before this step.)
parent f59a1826
......@@ -1979,6 +1979,7 @@ logs_empty_and_mark_files_at_shutdown(void)
goto wait_suspend_loop;
case SRV_PURGE:
case SRV_WORKER:
ut_ad(!"purge was not shut down");
srv_purge_wakeup();
thread_name = "purge thread";
goto wait_suspend_loop;
......
......@@ -2980,8 +2980,11 @@ srv_purge_wakeup()
{
ut_ad(!srv_read_only_mode);
if (srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
return;
}
do {
srv_release_threads(SRV_PURGE, 1);
if (srv_n_purge_threads > 1) {
......@@ -2989,7 +2992,9 @@ srv_purge_wakeup()
srv_release_threads(SRV_WORKER, n_workers);
}
}
} while (!srv_running
&& (srv_sys.n_threads_active[SRV_WORKER]
|| srv_sys.n_threads_active[SRV_PURGE]));
}
/** Check if tablespace is being truncated.
......
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