Skip to content

Commit

Permalink
MDEV-26819 SET GLOBAL innodb_max_dirty_pages_pct=0 occasionally fails…
Browse files Browse the repository at this point in the history
… to trigger writes

innodb_max_dirty_pages_pct_update(),
innodb_max_dirty_pages_pct_lwm_update():
Invoke buf_pool.page_cleaner_wakeup() in order to wake up
buf_flush_page_cleaner. This allows the test innodb.page_cleaner
to run without any occasional timeouts.

The occasional hangs were introduced by
commit 7b1252c (MDEV-24278).
  • Loading branch information
dr-m committed Oct 13, 2021
1 parent ddf95e8 commit f1acd9f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/buf/buf0flu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static void buf_flush_validate_skip()
#endif /* UNIV_DEBUG */

/** Wake up the page cleaner if needed */
inline void buf_pool_t::page_cleaner_wakeup()
void buf_pool_t::page_cleaner_wakeup()
{
if (!page_cleaner_idle())
return;
Expand Down
14 changes: 12 additions & 2 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17214,7 +17214,12 @@ innodb_max_dirty_pages_pct_update(
}

srv_max_buf_pool_modified_pct = in_val;
pthread_cond_signal(&buf_pool.do_flush_list);

mysql_mutex_unlock(&LOCK_global_system_variables);
mysql_mutex_lock(&buf_pool.flush_list_mutex);
buf_pool.page_cleaner_wakeup();
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
mysql_mutex_lock(&LOCK_global_system_variables);
}

/****************************************************************//**
Expand Down Expand Up @@ -17245,7 +17250,12 @@ innodb_max_dirty_pages_pct_lwm_update(
}

srv_max_dirty_pages_pct_lwm = in_val;
pthread_cond_signal(&buf_pool.do_flush_list);

mysql_mutex_unlock(&LOCK_global_system_variables);
mysql_mutex_lock(&buf_pool.flush_list_mutex);
buf_pool.page_cleaner_wakeup();
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
mysql_mutex_lock(&LOCK_global_system_variables);
}

/*************************************************************//**
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/include/buf0buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ class buf_pool_t
return page_cleaner_is_idle;
}
/** Wake up the page cleaner if needed */
inline void page_cleaner_wakeup();
void page_cleaner_wakeup();

/** Register whether an explicit wakeup of the page cleaner is needed */
void page_cleaner_set_idle(bool deep_sleep)
Expand Down

0 comments on commit f1acd9f

Please sign in to comment.