mariadb/storage/innobase/buf
Marko Mäkelä 719321e78e MDEV-11638 Encryption causes race conditions in InnoDB shutdown
InnoDB shutdown failed to properly take fil_crypt_thread() into account.
The encryption threads were signalled to shut down together with other
non-critical tasks. This could be much too early in case of slow shutdown,
which could need minutes to complete the purge. Furthermore, InnoDB
failed to wait for the fil_crypt_thread() to actually exit before
proceeding to the final steps of shutdown, causing the race conditions.

Furthermore, the log_scrub_thread() was shut down way too early.
Also it should remain until the SRV_SHUTDOWN_FLUSH_PHASE.

fil_crypt_threads_end(): Remove. This would cause the threads to
be terminated way too early.

srv_buf_dump_thread_active, srv_dict_stats_thread_active,
lock_sys->timeout_thread_active, log_scrub_thread_active,
srv_monitor_active, srv_error_monitor_active: Remove a race condition
between startup and shutdown, by setting these in the startup thread
that creates threads, not in each created thread. In this way, once the
flag is cleared, it will remain cleared during shutdown.

srv_n_fil_crypt_threads_started, fil_crypt_threads_event: Declare in
global rather than static scope.

log_scrub_event, srv_log_scrub_thread_active, log_scrub_thread():
Declare in static rather than global scope. Let these be created by
log_init() and freed by log_shutdown().

rotate_thread_t::should_shutdown(): Do not shut down before the
SRV_SHUTDOWN_FLUSH_PHASE.

srv_any_background_threads_are_active(): Remove. These checks now
exist in logs_empty_and_mark_files_at_shutdown().

logs_empty_and_mark_files_at_shutdown(): Shut down the threads in
the proper order. Keep fil_crypt_thread() and log_scrub_thread() alive
until SRV_SHUTDOWN_FLUSH_PHASE, and check that they actually terminate.
2017-01-05 00:20:06 +02:00
..
buf0buddy.cc 5.6.31 2016-06-21 14:21:03 +02:00
buf0buf.cc MDEV-10368: get_latest_version() called too often 2016-12-13 11:51:33 +02:00
buf0checksum.cc Merge tag 'mariadb-10.0.20' into 10.1 2015-06-27 20:35:26 +02:00
buf0dblwr.cc MDEV-9282 Debian: the Lintian complains about "shlib-calls-exit" in ha_innodb.so 2016-12-28 15:54:24 +02:00
buf0dump.cc MDEV-11638 Encryption causes race conditions in InnoDB shutdown 2017-01-05 00:20:06 +02:00
buf0flu.cc Merge branch '10.0' into 10.1 2016-06-28 22:01:55 +02:00
buf0lru.cc Merge branch '10.0' into 10.1 2016-06-28 22:01:55 +02:00
buf0mtflu.cc MDEV-7424: InnoDB: Assertion failure in thread 139901753345792 2015-01-14 19:24:37 +02:00
buf0rea.cc MDEV-8588: Assertion failure in file ha_innodb.cc line 21140 if at least one encrypted table exists and encryption service is not available 2015-09-04 20:19:45 +03:00