summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-04-25 15:03:38 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2023-04-25 15:03:38 +0300
commitc22ab93f8af5baf2cefe802dfd4a3819225d6df5 (patch)
tree9357f74d0b14ff006dca12550f0509551091f6bc
parent818d5e48146b7938a7ccca4ccf819afe3ea8a005 (diff)
downloadmariadb-git-c22ab93f8af5baf2cefe802dfd4a3819225d6df5.tar.gz
MDEV-26827 fixup: Prevent a hang in LRU eviction
buf_pool_t::page_cleaner_wakeup(): If for_LRU=true, wake up the page cleaner immediately, also when it is in a timed wait. This avoids an unnecessary delay of up to 1 second.
-rw-r--r--storage/innobase/buf/buf0flu.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index fff70eefd13..b201250bc3b 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -115,7 +115,12 @@ static void buf_flush_validate_skip()
void buf_pool_t::page_cleaner_wakeup(bool for_LRU)
{
if (!page_cleaner_idle())
+ {
+ if (for_LRU)
+ /* Ensure that the page cleaner is not in a timed wait. */
+ pthread_cond_signal(&do_flush_list);
return;
+ }
double dirty_pct= double(UT_LIST_GET_LEN(buf_pool.flush_list)) * 100.0 /
double(UT_LIST_GET_LEN(buf_pool.LRU) + UT_LIST_GET_LEN(buf_pool.free));
double pct_lwm= srv_max_dirty_pages_pct_lwm;