Commit 9d8e83b6 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-26356 fixup: Adjust innodb_max_purge_lag_wait

innodb_max_purge_lag_wait_update(): To align with
purge_coordinator_state::refresh(), we must trigger a page flush batch
if the last log checkpoint is too old.

This was caught in a hang of the test innodb_gis.rtree_compress.
parent 03c09837
......@@ -228,6 +228,14 @@ static void innodb_max_purge_lag_wait_update(THD *thd, st_mysql_sys_var *,
{
if (thd_kill_level(thd))
break;
/* Adjust for purge_coordinator_state::refresh() */
mysql_mutex_lock(&log_sys.mutex);
const lsn_t last= log_sys.last_checkpoint_lsn,
max_age= log_sys.max_checkpoint_age;
mysql_mutex_unlock(&log_sys.mutex);
const lsn_t lsn= log_sys.get_lsn();
if ((lsn - last) / 4 >= max_age / 5)
buf_flush_ahead(last + max_age / 5, false);
srv_wake_purge_thread_if_not_active();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
......
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