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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: 507
Merged at revision: 522
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1238039
Merge into: lp:percona-server/5.6
Prerequisite: lp:~laurynas-biveinis/percona-server/lru-manager
Diff against target: 37 lines (+11/-2)
1 file modified
Percona-Server/storage/innobase/buf/buf0flu.cc (+11/-2)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1238039
Reviewer Review Type Date Requested Status
George Ormond Lorch III g2 Approve
Review via email: mp+197343@code.launchpad.net

Description of the change

Fix bug 1238039: a regression in page cleaner thread furious flushing support. When page cleaner thread was allowed to skip sleeps in the case of empty free lists or large checkpoint age, each iteration was no longer required to take 1 second, the server could have been considered inactive if the sleep was skipped and the page cleaner iteration was short. Which had an effect of performing idle server flush list flushing for innodb I/O capacity-number of pages instead of a busy server adaptive flushing.

The fix is to maintain the timestamp of the last last_activity update
in the main page cleaner thread loop. Then, perform busy server tasks
not only if the server activity has advanced, but also if it has not
advanced for less than 1 second.

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

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) :
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-12-02 11:15:58 +0000
3+++ Percona-Server/storage/innobase/buf/buf0flu.cc 2013-12-02 11:15:59 +0000
4@@ -2645,6 +2645,7 @@
5 ulint next_loop_time = ut_time_ms() + 1000;
6 ulint n_flushed = 0;
7 ulint last_activity = srv_get_activity_count();
8+ ulint last_activity_time = ut_time_ms();
9
10 ut_ad(!srv_read_only_mode);
11
12@@ -2666,6 +2667,7 @@
13 while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
14
15 ulint page_cleaner_sleep_time;
16+ ibool server_active;
17
18 srv_current_thread_priority = srv_cleaner_thread_priority;
19
20@@ -2683,8 +2685,15 @@
21
22 next_loop_time = ut_time_ms() + page_cleaner_sleep_time;
23
24- if (srv_check_activity(last_activity)) {
25- last_activity = srv_get_activity_count();
26+ server_active = srv_check_activity(last_activity);
27+ if (server_active
28+ || ut_time_ms() - last_activity_time < 1000) {
29+
30+ if (server_active) {
31+
32+ last_activity = srv_get_activity_count();
33+ last_activity_time = ut_time_ms();
34+ }
35
36 /* Flush pages from flush_list if required */
37 n_flushed += page_cleaner_flush_pages_if_needed();

Subscribers

People subscribed via source and target branches