[MDEV-24544] innodb_buffer_pool_wait_free is not protected by mutex Created: 2021-01-07  Updated: 2021-01-07  Resolved: 2021-01-07

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5
Fix Version/s: 10.5.9

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: performance

Issue Links:
Relates
relates to MDEV-24350 buf_dblwr unnecessarily uses memory-i... Closed

 Description   

The underlying variable of the counter innodb_buffer_pool_wait_free is only modified in buf_LRU_get_free_block(), where we could easily do that after acquiring buf_pool.mutex.

Furthermore, the variable is being duplicated for no good reason:

	export_vars.innodb_buffer_pool_wait_free =
		srv_stats.buf_pool_wait_free;

Because this counter should not be in a time-critical execution path, I think that we can replace both of the above variables with buf_pool.stat.LRU_waits, which would be incremented while holding buf_pool.mutex, to make the counter more accurate. I think that we can allow the reads to remain dirty, not acquiring the mutex.



 Comments   
Comment by Marko Mäkelä [ 2021-01-07 ]

This affects older versions as well, but the fix is only possible with 10.5, thanks to MDEV-15053 removing multiple buffer pool instances.

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