summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-10-13 15:16:23 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-10-13 15:16:23 +0300
commitf1acd9f14bd054b8d8d576c6fe567226c097132d (patch)
tree072daacf999cd34309c571434fe274b50b0913b2
parentddf95e834da0b7efc9c464e64c351d933ad671e5 (diff)
downloadmariadb-git-f1acd9f14bd054b8d8d576c6fe567226c097132d.tar.gz
MDEV-26819 SET GLOBAL innodb_max_dirty_pages_pct=0 occasionally fails 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 7b1252c03d7131754d9503560fe507b33ca1f8b4 (MDEV-24278).
-rw-r--r--storage/innobase/buf/buf0flu.cc2
-rw-r--r--storage/innobase/handler/ha_innodb.cc14
-rw-r--r--storage/innobase/include/buf0buf.h2
3 files changed, 14 insertions, 4 deletions
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index 7bf26515e88..c503b97f776 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -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;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index e0f2b020e89..c2d98906e52 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -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);
}
/****************************************************************//**
@@ -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);
}
/*************************************************************//**
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index e9cd1f9a205..e5e15730253 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1935,7 +1935,7 @@ public:
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)