[MDEV-26819] SET GLOBAL innodb_max_dirty_pages_pct=0 occasionally fails to trigger writes Created: 2021-10-13  Updated: 2021-10-13  Resolved: 2021-10-13

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5, 10.6, 10.7
Fix Version/s: 10.5.13, 10.6.5

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: flush, performance, regression-10.5

Issue Links:
Blocks
Problem/Incident
is caused by MDEV-24278 InnoDB page cleaner keeps waking up o... Closed

 Description   

The test innodb.page_cleaner would occasionally time out like this:

@@ -2,6 +2,11 @@
 SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;
 SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
 SET GLOBAL innodb_max_dirty_pages_pct=0.0;
+Timeout in wait_condition.inc for SELECT variable_value = 0
+FROM information_schema.global_status
+WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY'
+Id	User	Host	db	Command	Time	State	Info	Progress
+28	root	localhost	test	Query	0	starting	show full processlist	0.000
 SET GLOBAL innodb_max_dirty_pages_pct=90.0;
 CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_10000;
 SELECT variable_value>0 FROM information_schema.global_status

The reason is that we fail to wake up the buf_pool_page_cleaner from pthread_cond_wait() when innodb_max_dirty_pages_pct is assigned. Invoking pthread_cond_signal() on the condition variable is not enough, not even while holding buf_pool.flush_list_mutex.

Invoking buf_pool.page_cleaner_wakeup() seems to do the trick. With that fix, the test will execute several hundred times without failures.


Generated at Thu Feb 08 09:48:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.