diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2018-04-10 17:43:18 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2018-04-10 17:43:18 +0300 |
commit | 45e6d0aebf023acb50671f82b87e6de5d1e78f5e (patch) | |
tree | c6079a18e158706a0a877d1b522ceb851d6055b5 /storage/innobase/log/log0log.cc | |
parent | f5cb66fb97101bc0f17ff879025fd7146c032cbc (diff) | |
parent | 2e91eb7547dfc7c9a999568bd8245832bbcfefaa (diff) | |
download | mariadb-git-45e6d0aebf023acb50671f82b87e6de5d1e78f5e.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'storage/innobase/log/log0log.cc')
-rw-r--r-- | storage/innobase/log/log0log.cc | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 9ff474697be..4e3722391b3 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -33,6 +33,7 @@ Created 12/9/1995 Heikki Tuuri #include "ha_prototypes.h" #include <debug_sync.h> +#include <my_service_manager.h> #include "log0log.h" #include "log0crypt.h" @@ -1132,6 +1133,12 @@ log_write_up_to( return; } + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { + service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL, + "log write up to: " LSN_PF, + lsn); + } + loop: ut_ad(++loop_count < 128); @@ -1905,7 +1912,9 @@ loop: os_event_set(recv_sys->flush_start); } } - os_thread_sleep(100000); +#define COUNT_INTERVAL 600U +#define CHECK_INTERVAL 100000U + os_thread_sleep(CHECK_INTERVAL); count++; @@ -1918,7 +1927,11 @@ loop: && srv_force_recovery < SRV_FORCE_NO_TRX_UNDO ? trx_sys_any_active_transactions() : 0) { - if (srv_print_verbose_log && count > 600) { + if (srv_print_verbose_log && count > COUNT_INTERVAL) { + service_manager_extend_timeout( + COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2, + "Waiting for %lu active transactions to finish", + (ulong) total_trx); ib::info() << "Waiting for " << total_trx << " active" << " transactions to finish"; @@ -1956,7 +1969,10 @@ loop: if (thread_name) { ut_ad(!srv_read_only_mode); wait_suspend_loop: - if (srv_print_verbose_log && count > 600) { + service_manager_extend_timeout( + COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2, + "Waiting for %s to exit", thread_name); + if (srv_print_verbose_log && count > COUNT_INTERVAL) { ib::info() << "Waiting for " << thread_name << "to exit"; count = 0; @@ -1991,12 +2007,16 @@ wait_suspend_loop: before proceeding further. */ count = 0; + service_manager_extend_timeout(COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2, + "Waiting for page cleaner"); while (buf_page_cleaner_is_active) { ++count; - os_thread_sleep(100000); - if (srv_print_verbose_log && count > 600) { - ib::info() << "Waiting for page_cleaner to" - " finish flushing of buffer pool"; + os_thread_sleep(CHECK_INTERVAL); + if (srv_print_verbose_log && count > COUNT_INTERVAL) { + service_manager_extend_timeout(COUNT_INTERVAL * CHECK_INTERVAL/1000000 * 2, + "Waiting for page cleaner"); + ib::info() << "Waiting for page_cleaner to " + "finish flushing of buffer pool"; count = 0; } } @@ -2067,6 +2087,8 @@ wait_suspend_loop: } if (!srv_read_only_mode) { + service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL, + "ensuring dirty buffer pool are written to log"); log_make_checkpoint_at(LSN_MAX, TRUE); log_mutex_enter(); @@ -2082,22 +2104,6 @@ wait_suspend_loop: goto loop; } - fil_flush_file_spaces(FIL_TYPE_TABLESPACE); - fil_flush_file_spaces(FIL_TYPE_LOG); - - /* The call fil_write_flushed_lsn_to_data_files() will - bypass the buffer pool: therefore it is essential that - the buffer pool has been completely flushed to disk! */ - - if (!buf_all_freed()) { - if (srv_print_verbose_log && count > 600) { - ib::info() << "Waiting for dirty buffer pages" - " to be flushed"; - count = 0; - } - - goto loop; - } } else { lsn = srv_start_lsn; } @@ -2107,8 +2113,9 @@ wait_suspend_loop: /* Make some checks that the server really is quiet */ ut_a(srv_get_active_thread_type() == SRV_NONE); - bool freed = buf_all_freed(); - ut_a(freed); + service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL, + "Free innodb buffer pool"); + buf_all_freed(); ut_a(lsn == log_sys->lsn || srv_force_recovery == SRV_FORCE_NO_LOG_REDO); @@ -2134,9 +2141,6 @@ wait_suspend_loop: /* Make some checks that the server really is quiet */ ut_a(srv_get_active_thread_type() == SRV_NONE); - freed = buf_all_freed(); - ut_a(freed); - ut_a(lsn == log_sys->lsn || srv_force_recovery == SRV_FORCE_NO_LOG_REDO); } |