[MDEV-23410] buf_LRU_scan_and_free_block() fails to stop at first freed block Created: 2020-08-05  Updated: 2020-08-07  Resolved: 2020-08-06

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

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

Issue Links:
Blocks
blocks MDEV-23399 10.5 performance regression with IO-b... Closed
Problem/Incident
is caused by MDEV-15053 Reduce buf_pool_t::mutex contention Closed

 Description   

MDEV-15053 refactored the InnoDB buffer pool and page flushing. It unfortunately included one unintended functional change that seriously hurts performance in workloads where the buffer pool is big, but the working set is even bigger. The termination condition for a loop was misplaced:

diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index 5d9a39b0c9e..5e36a51690a 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -570,8 +570,9 @@ static bool buf_LRU_free_from_common_LRU_list(bool scan_all)
 				ever being accessed. This gives us a measure of
 				the effectiveness of readahead */
 				++buf_pool.stat.n_ra_pages_evicted;
-				break;
 			}
+
+			break;
 		}
 	}
 

This bug will cause a permanent drop of throughput when a write-heavy database instance starts thrashing.

MDEV-23399 is suggesting larger changes to data structures and algorithms that could be beneficial in such workloads.



 Comments   
Comment by Axel Schwenke [ 2020-08-05 ]

That patch makes quite a difference. tpcc throughput went up to 440 tps (2 hour average)

Build TPS
MariaDB 10.5.4 290
10.5 snapshot before patch 227
10.5 snapshot with patch 440
Comment by Marko Mäkelä [ 2020-08-06 ]

Even with this fix, single-page flushing remains a performance bottleneck in some write-heavy workloads where the working set does not fit in the buffer pool.

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