"buf_flush_LRU is lazy" | buf_flush_common() calls buf_dblwr_flush_buffered_writes() even when no pages flushed

Bug #1231918 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Wishlist
Laurynas Biveinis
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
Wishlist
Laurynas Biveinis

Bug Description

This is a copy of http://bugs.mysql.com/bug.php?id=69170, namely the reported issue

"1) buf_flush_common always calls buf_dblwr_flush_buffered_writes. Shouldn't this only be done when page_count > 0?"

which later the bug was kept open about, and

[27 Sep 10:15] Laurynas Biveinis

Re. Mark's problem 1), merely skipping buf_dblwr_flush_buffered_writes() if page_count == 0 will be only a partial fix in the presence of compressed pages for LRU flushes, because this value will originate from buf_do_LRU_batch():

 if (buf_LRU_evict_from_unzip_LRU(buf_pool)) {
  count += buf_free_from_unzip_LRU_list_batch(buf_pool, max);
 }

 if (max > count) {
  count += buf_flush_LRU_list_batch(buf_pool, max - count);
 }

Notice a mixup of evicted and flushed pages. In the case we will satisfy this LRU flush batch purely by unzip_LRU eviction and no flushing, we will still get page_count > 0 in buf_flush_common().

We are exploring a fix here and elsewhere of replacing single value counters with two-field structs for flushed and evicted pages.

Tags: innodb

Related branches

tags: added: innodb
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2430

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.