Merge lp:~laurynas-biveinis/percona-server/bug1234029 into lp:percona-server/5.6

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Sergei Glushchenko
Approved revision: no longer in the source branch.
Merged at revision: 449
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1234029
Merge into: lp:percona-server/5.6
Diff against target: 49 lines (+3/-7)
1 file modified
Percona-Server/storage/innobase/buf/buf0flu.cc (+3/-7)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1234029
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 Approve
Review via email: mp+188818@code.launchpad.net

Description of the change

Fix bug 1234029 (buf_flush_LRU_list_batch() accounts flushed pages
multiple times).

Fix by not having a separate variable for the last batch flushed page
count at all, and passing the running total variable n->flushed to
buf_flush_page_and_try_neigbors() to add to.

At the same time fix the buf_flush_LRU_list_batch() return type to
void to match its use.

http://jenkins.percona.com/job/percona-server-5.6-param/333/

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Approve.

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/storage/innobase/buf/buf0flu.cc'
2--- Percona-Server/storage/innobase/buf/buf0flu.cc 2013-09-30 12:13:10 +0000
3+++ Percona-Server/storage/innobase/buf/buf0flu.cc 2013-10-02 12:20:55 +0000
4@@ -1512,7 +1512,7 @@
5 @return number of blocks for which the write request was queued. */
6 __attribute__((nonnull))
7 static
8-ulint
9+void
10 buf_flush_LRU_list_batch(
11 /*=====================*/
12 buf_pool_t* buf_pool, /*!< in: buffer pool instance */
13@@ -1528,7 +1528,6 @@
14 ulint lru_position = 0;
15 ulint max_lru_position;
16 ulint max_scanned_pages;
17- ulint count = 0;
18 ulint free_len = UT_LIST_GET_LEN(buf_pool->free);
19 ulint lru_len = UT_LIST_GET_LEN(buf_pool->LRU);
20
21@@ -1593,9 +1592,8 @@
22
23 if (buf_flush_page_and_try_neighbors(
24 bpage,
25- BUF_FLUSH_LRU, max, &count)) {
26+ BUF_FLUSH_LRU, max, &n->flushed)) {
27
28- n->flushed += count;
29 lru_position = 0;
30
31 /* LRU list mutex was released.
32@@ -1616,7 +1614,7 @@
33 /* We keep track of all flushes happening as part of LRU
34 flush. When estimating the desired rate at which flush_list
35 should be flushed, we factor in this value. */
36- buf_pool->stat.buf_lru_flush_page_count += count;
37+ buf_pool->stat.buf_lru_flush_page_count += n->flushed;
38
39 if (scanned) {
40 MONITOR_INC_VALUE_CUMULATIVE(
41@@ -1625,8 +1623,6 @@
42 MONITOR_LRU_BATCH_SCANNED_PER_CALL,
43 scanned);
44 }
45-
46- return(count);
47 }
48
49 /*******************************************************************//**

Subscribers

People subscribed via source and target branches