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.)
This commit is contained in:
Marko Mäkelä 2017-12-01 15:02:04 +02:00
commit 8d24bef640
2 changed files with 8 additions and 2 deletions

View file

@ -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.