Commit 93189df4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-33361 Excessive delays in SET GLOBAL innodb_log_file_size

innodb_log_file_size_update(): Wait for buf_pool.done_flush_list
(that a flush batch has completed), not buf_pool.do_flush_list
(that the buf_flush_page_cleaner was woken up).

The condition variable buf_pool.done_flush_list is broadcast by the
buf_flush_page_cleaner() at the end of each batch, which is when the
log checkpoint can advance and where any log resizing may be completed.
The purpose of the condition variable buf_pool.do_flush_list is to
wake up the buf_flush_page_cleaner() thread because there is work to do.
If no thread is signaling that condition variable, this loop could
unnecessarily wait for up to 5 seconds too long for the log resizing
to be completed. By consuming signals it could also prevent the
buf_flush_page_cleaner() thread from waking up.

Tested by: Matthias Leich
parent ea9a6a14
...@@ -18452,7 +18452,7 @@ static void innodb_log_file_size_update(THD *thd, st_mysql_sys_var*, ...@@ -18452,7 +18452,7 @@ static void innodb_log_file_size_update(THD *thd, st_mysql_sys_var*,
const bool in_progress(buf_pool.get_oldest_modification(LSN_MAX) < const bool in_progress(buf_pool.get_oldest_modification(LSN_MAX) <
log_sys.resize_in_progress()); log_sys.resize_in_progress());
if (in_progress) if (in_progress)
my_cond_timedwait(&buf_pool.do_flush_list, my_cond_timedwait(&buf_pool.done_flush_list,
&buf_pool.flush_list_mutex.m_mutex, &abstime); &buf_pool.flush_list_mutex.m_mutex, &abstime);
mysql_mutex_unlock(&buf_pool.flush_list_mutex); mysql_mutex_unlock(&buf_pool.flush_list_mutex);
if (!log_sys.resize_in_progress()) if (!log_sys.resize_in_progress())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment