MDEV-23399 fixup: Avoid crash on Mariabackup shutdown

innodb_preshutdown(): Terminate the encryption threads before
the page cleaner thread can be shut down.

innodb_shutdown(): Always wait for the encryption threads and
page cleaner to shut down.

srv_shutdown_all_bg_threads(): Wait for the encryption threads and
the page cleaner to shut down. (After an aborted startup,
innodb_shutdown() would not be called.)

row_get_background_drop_list_len_low(): Remove.

os_thread_count: Remove. Alternatively, at the end of
srv_shutdown_all_bg_threads() we could try to wait longer
for the count to reach 0. On some platforms, an assertion
os_thread_count==0 could fail even after a small delay,
even though in the core dump all threads would have exited.

srv_shutdown_threads(): Renamed from srv_shutdown_all_bg_threads().
Do not wait for the page cleaner to shut down, because the later
innodb_shutdown(), which may invoke
logs_empty_and_mark_files_at_shutdown(), assumes that it exists.
This commit is contained in:
Marko Mäkelä 2020-10-26 15:04:24 +02:00
commit 5999d5120e
5 changed files with 32 additions and 62 deletions

View file

@ -3418,15 +3418,11 @@ xb_data_files_init()
return(xb_load_tablespaces());
}
/************************************************************************
Destroy the tablespace memory cache. */
static
void
xb_data_files_close()
/** Destroy the tablespace memory cache. */
static void xb_data_files_close()
{
ut_ad(!os_thread_count);
fil_close_all_files();
buf_dblwr.close();
fil_close_all_files();
buf_dblwr.close();
}
/***********************************************************************