mariadb/storage/innobase/buf
Marko Mäkelä 417434f12d MDEV-13039 innodb_fast_shutdown=0 may fail to purge all undo log
When a slow shutdown is performed soon after spawning some work for
background threads that can create or commit transactions, it is possible
that new transactions are started or committed after the purge has finished.
This is violating the specification of innodb_fast_shutdown=0, namely that
the purge must be completed. (None of the history of the recent transactions
would be purged.)

Also, it is possible that the purge threads would exit in slow shutdown
while there exist active transactions, such as recovered incomplete
transactions that are being rolled back. Thus, the slow shutdown could
fail to purge some undo log that becomes purgeable after the transaction
commit or rollback.

srv_undo_sources: A flag that indicates if undo log can be generated
or the persistent, whether by background threads or by user SQL.
Even when this flag is clear, active transactions that already exist
in the system may be committed or rolled back.

innodb_shutdown(): Renamed from innobase_shutdown_for_mysql().
Do not return an error code; the operation never fails.
Clear the srv_undo_sources flag, and also ensure that the background
DROP TABLE queue is empty.

srv_purge_should_exit(): Do not allow the purge to exit if
srv_undo_sources are active or the background DROP TABLE queue is not
empty, or in slow shutdown, if any active transactions exist
(and are being rolled back).

srv_purge_coordinator_thread(): Remove some previous workarounds
for this bug.

innobase_start_or_create_for_mysql(): Set buf_page_cleaner_is_active
and srv_dict_stats_thread_active directly. Set srv_undo_sources before
starting the purge subsystem, to prevent immediate shutdown of the purge.
Create dict_stats_thread and fts_optimize_thread immediately
after setting srv_undo_sources, so that shutdown can use this flag to
determine if these subsystems were started.

dict_stats_shutdown(): Shut down dict_stats_thread. Backported from 10.2.

srv_shutdown_table_bg_threads(): Remove (unused).
2017-06-09 16:20:42 +03:00
..
buf0buddy.cc 5.6.31 2016-06-21 14:21:03 +02:00
buf0buf.cc Merge 5.5 into 10.0 2017-05-29 13:15:36 +03:00
buf0checksum.cc Merge branch 'merge-innodb-5.6' into 10.0 2015-06-16 11:08:23 +02:00
buf0dblwr.cc 5.6.36 2017-05-15 17:17:16 +03:00
buf0dump.cc Merge branch 'merge-innodb-5.6' into bb-10.0-vicentiu 2017-05-17 14:53:28 +03:00
buf0flu.cc MDEV-13039 innodb_fast_shutdown=0 may fail to purge all undo log 2017-06-09 16:20:42 +03:00
buf0lru.cc MDEV-12674 Innodb_row_lock_current_waits has overflow 2017-05-12 12:24:53 +03:00
buf0rea.cc MDEV-12534 Use atomic operations whenever available 2017-04-20 16:29:12 +03:00