[MDEV-27969] buf_page_cleaner not getting signaled event if dirty_pct > innodb_max_dirty_pages_pct_lwm Created: 2022-03-01  Updated: 2022-03-01  Resolved: 2022-03-01

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

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

Attachments: PNG File 10.8.baseline.png     PNG File 10.8.patched.png    
Issue Links:
Problem/Incident
is caused by MDEV-27774 Reduce scalability bottlenecks in mtr... Closed

 Description   
  • buf_page_cleaner is signaled when the pages are added to the flush list.
  • As part of the MDEV-27774 changes the logic to signal buf_page_cleaner
    accidentally got missed due to pass-by-value issue (expected pass-by-reference).
    [mtr_t::commit flow would signal page cleaner if there are modified
    blocks. The object that captured modified blocks was expected to get
    passed by reference but accidentally got passed by value and so
    page-cleaner thread was never signaled].

[Non-availability of the flushing of-course has effect on performance as could be observed from the attached graph].



 Comments   
Comment by Marko Mäkelä [ 2022-03-01 ]

Thank you! The following code indeed is unreachable because the object rb was being passed by value and not by reference, and only a copy of the mutable data member rb.modified was ever changed:

diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index f486c2fe0e7..10f1d6f2d19 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -462,6 +462,7 @@ void mtr_t::commit()
 
     if (rb.modified)
     {
+      ut_error;
       mysql_mutex_lock(&buf_pool.flush_list_mutex);
       buf_pool.flush_list_requests+= rb.modified;
       buf_pool.page_cleaner_wakeup();

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