Bug #65061 LRU flush rate calculation is based on invalid values
Submitted: 20 Apr 2012 23:12 Modified: 11 May 2012 19:09
Reporter: Davi Arnaut (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.5.20, 5.5.22,5.6.6-m9 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution, innodb_adaptive_flushing

[20 Apr 2012 23:12] Davi Arnaut
Description:
The internal counter for the number of pages flushed as part of LRU flushing is being incremented twice, on in buf_flush_LRU_list_batch() and again in buf_flush_common().

This leads to an incorrect calculation of the rate at which LRU flush is happening, which might later affect the statistics associated with adaptive flushing.

This is essentially a follow up on Bug#65030.

How to repeat:
Manual inspection.

Suggested fix:
--- a/storage/innobase/buf/buf0flu.c
+++ b/storage/innobase/buf/buf0flu.c
@@ -1577,11 +1577,6 @@ buf_flush_LRU_list_batch(
                }
        } while (bpage != NULL && count < max);
 
-       /* We keep track of all flushes happening as part of LRU
-       flush. When estimating the desired rate at which flush_list
-       should be flushed, we factor in this value. */
-       buf_lru_flush_page_count += count;
-
        ut_ad(buf_pool_mutex_own(buf_pool));
 
        return(count);
[23 Apr 2012 13:45] Valeriy Kravchuk
Thank you for the problem report.
[11 May 2012 19:09] John Russell
Added to changelog for 5.5.25, 5.6.6: 

Improved the algorithm related to adaptive flushing. This fix
increases the rate of flushing in cases where compression is used and
the data set is larger than the buffer pool, leading to eviction.