summaryrefslogtreecommitdiff
path: root/storage/innobase/srv/srv0start.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-07-21 15:44:32 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-07-22 10:11:35 +0300
commita4dc9265792919eb1ad156780e1a93dc4c7c6ce8 (patch)
tree2bab3b20b4d733e9518777e94098a0cb4bec7790 /storage/innobase/srv/srv0start.cc
parent641f09398fdc37c6f3b0ec6731d5f246ecf24866 (diff)
downloadmariadb-git-a4dc9265792919eb1ad156780e1a93dc4c7c6ce8.tar.gz
MDEV-26193: Wake up purge less often
Starting with commit 6e12ebd4a748eba738e08ad1d7f5dec782ff63ee (MDEV-25062), srv_wake_purge_thread_if_not_active() became more expensive operation, especially on NUMA systems, because instead of reading an atomic global variable trx_sys.rseg_history_len we are traversing up to 128 cache lines in trx_sys.history_exists(). trx_t::commit_cleanup(): Do not wake up purge at all. We will wake up purge about once per second in srv_master_callback(). srv_master_do_active_tasks(), srv_master_do_idle_tasks(): Move some duplicated code to srv_master_callback(). srv_master_callback(): Invoke purge_coordinator_timer_callback() to ensure that purge will be periodically woken up, even if the latest execution of trx_t::commit_cleanup() allowed the purge view to advance but did not wake up purge. Do not call log_free_check(), because every thread that is going to generate redo log is supposed to call that function anyway, before acquiring any page latches. Additional calls to the function every few seconds should not make any difference. srv_shutdown_threads(): Ensure that srv_shutdown_state can be at most SRV_SHUTDOWN_INITIATED in srv_master_callback(), by first invoking srv_master_timer.reset() before changing srv_shutdown_state. (Note: We first terminate the srv_master_callback and only then terminate the purge tasks. Thus, the purge subsystem should exist when srv_master_callback() invokes purge_coordinator_timer_callback() if it was initiated in the first place.
Diffstat (limited to 'storage/innobase/srv/srv0start.cc')
-rw-r--r--storage/innobase/srv/srv0start.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index bac9a3b25b5..3f0ccf44b1e 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -812,9 +812,9 @@ srv_open_tmp_tablespace(bool create_new_db)
static void srv_shutdown_threads()
{
ut_ad(!srv_undo_sources);
- srv_shutdown_state = SRV_SHUTDOWN_EXIT_THREADS;
ut_d(srv_master_thread_enable());
srv_master_timer.reset();
+ srv_shutdown_state = SRV_SHUTDOWN_EXIT_THREADS;
if (purge_sys.enabled()) {
srv_purge_shutdown();