Merge lp:~laurynas-biveinis/percona-server/xtradb-af-lsn-age-tuning-5.6 into lp:percona-server/5.6

Proposed by Laurynas Biveinis
Status: Merged
Merged at revision: 452
Proposed branch: lp:~laurynas-biveinis/percona-server/xtradb-af-lsn-age-tuning-5.6
Merge into: lp:percona-server/5.6
Diff against target: 195 lines (+113/-4)
7 files modified
Percona-Server/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result (+21/-0)
Percona-Server/mysql-test/suite/sys_vars/t/innodb_cleaner_lsn_age_factor_basic.test (+28/-0)
Percona-Server/storage/innobase/buf/buf0flu.cc (+16/-4)
Percona-Server/storage/innobase/handler/ha_innodb.cc (+25/-0)
Percona-Server/storage/innobase/include/buf0types.h (+15/-0)
Percona-Server/storage/innobase/include/srv0srv.h (+4/-0)
Percona-Server/storage/innobase/srv/srv0srv.cc (+4/-0)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/xtradb-af-lsn-age-tuning-5.6
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 Approve
Vadim Tkachenko Pending
Laurynas Biveinis Pending
Review via email: mp+189020@code.launchpad.net

This proposal supersedes a proposal from 2013-10-03.

Description of the change

2nd MP:

Replaced the option with an enum with descriptive value names.
http://jenkins.percona.com/job/percona-server-5.6-param/340/

1st MP:

Add new LSN age factor formula for page cleaner adaptive flushing,
implementing
https://blueprints.launchpad.net/percona-server/+spec/af-lsn-age-tuning-5.6.

The formula choice is provided through a new ulong variable
innodb_cleaner_new_lsn_age_factor, defaulting to 1, which chooses the
new formula. The old formula is available through value 0. Other
values might be added in the future.

Add a sys_vars test for the new variable.

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

To post a comment you must log in.
Revision history for this message
Vadim Tkachenko (vadim-tk) wrote : Posted in a previous version of this proposal

for variable like innodb_cleaner_new_lsn_age_factor
I really prefer innodb_cleaner_lsn_age_factor = 'legacy' | 'advanced' or like that...

But if this is too hard to change at this moment, we can go with current implementation.

review: Needs Information
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

It was discussed on IRC and decided to go with 'legacy' | 'high_checkkpoint'

review: Needs Fixing
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
=== added file 'Percona-Server/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result'
--- Percona-Server/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/sys_vars/r/innodb_cleaner_lsn_age_factor_basic.result 2013-10-03 09:43:17 +0000
@@ -0,0 +1,21 @@
1SET @start_value = @@GLOBAL.innodb_cleaner_lsn_age_factor;
2SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
3@@GLOBAL.innodb_cleaner_lsn_age_factor
4high_checkpoint
5SELECT @@SESSION.innodb_cleaner_lsn_age_factor;
6ERROR HY000: Variable 'innodb_cleaner_lsn_age_factor' is a GLOBAL variable
7SET GLOBAL innodb_cleaner_lsn_age_factor='legacy';
8SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
9@@GLOBAL.innodb_cleaner_lsn_age_factor
10legacy
11SET GLOBAL innodb_cleaner_lsn_age_factor='high_checkpoint';
12SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
13@@GLOBAL.innodb_cleaner_lsn_age_factor
14high_checkpoint
15SET GLOBAL innodb_cleaner_lsn_age_factor=1.1;
16ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_lsn_age_factor'
17SET GLOBAL innodb_cleaner_lsn_age_factor=1e1;
18ERROR 42000: Incorrect argument type to variable 'innodb_cleaner_lsn_age_factor'
19SET GLOBAL innodb_cleaner_lsn_age_factor='foo';
20ERROR 42000: Variable 'innodb_cleaner_lsn_age_factor' can't be set to the value of 'foo'
21SET GLOBAL innodb_cleaner_lsn_age_factor = @start_value;
022
=== added file 'Percona-Server/mysql-test/suite/sys_vars/t/innodb_cleaner_lsn_age_factor_basic.test'
--- Percona-Server/mysql-test/suite/sys_vars/t/innodb_cleaner_lsn_age_factor_basic.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/sys_vars/t/innodb_cleaner_lsn_age_factor_basic.test 2013-10-03 09:43:17 +0000
@@ -0,0 +1,28 @@
1--source include/have_innodb.inc
2
3# A dynamic, global variable
4
5SET @start_value = @@GLOBAL.innodb_cleaner_lsn_age_factor;
6
7# Default value
8SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
9
10# Global only
11--error ER_INCORRECT_GLOBAL_LOCAL_VAR
12SELECT @@SESSION.innodb_cleaner_lsn_age_factor;
13
14# Correct values
15SET GLOBAL innodb_cleaner_lsn_age_factor='legacy';
16SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
17SET GLOBAL innodb_cleaner_lsn_age_factor='high_checkpoint';
18SELECT @@GLOBAL.innodb_cleaner_lsn_age_factor;
19
20# Incorrect values
21--error ER_WRONG_TYPE_FOR_VAR
22SET GLOBAL innodb_cleaner_lsn_age_factor=1.1;
23--error ER_WRONG_TYPE_FOR_VAR
24SET GLOBAL innodb_cleaner_lsn_age_factor=1e1;
25--error ER_WRONG_VALUE_FOR_VAR
26SET GLOBAL innodb_cleaner_lsn_age_factor='foo';
27
28SET GLOBAL innodb_cleaner_lsn_age_factor = @start_value;
029
=== modified file 'Percona-Server/storage/innobase/buf/buf0flu.cc'
--- Percona-Server/storage/innobase/buf/buf0flu.cc 2013-10-03 05:38:15 +0000
+++ Percona-Server/storage/innobase/buf/buf0flu.cc 2013-10-03 09:43:17 +0000
@@ -2398,10 +2398,22 @@
2398 lsn_age_factor = (age * 100) / max_async_age;2398 lsn_age_factor = (age * 100) / max_async_age;
23992399
2400 ut_ad(srv_max_io_capacity >= srv_io_capacity);2400 ut_ad(srv_max_io_capacity >= srv_io_capacity);
2401 return(static_cast<ulint>(2401 switch ((srv_cleaner_lsn_age_factor_t)srv_cleaner_lsn_age_factor) {
2402 ((srv_max_io_capacity / srv_io_capacity)2402 case SRV_CLEANER_LSN_AGE_FACTOR_LEGACY:
2403 * (lsn_age_factor * sqrt((double)lsn_age_factor)))2403 return(static_cast<ulint>(
2404 / 7.5));2404 ((srv_max_io_capacity / srv_io_capacity)
2405 * (lsn_age_factor
2406 * sqrt((double)lsn_age_factor)))
2407 / 7.5));
2408 case SRV_CLEANER_LSN_AGE_FACTOR_HIGH_CHECKPOINT:
2409 return(static_cast<ulint>(
2410 ((srv_max_io_capacity / srv_io_capacity)
2411 * (lsn_age_factor * lsn_age_factor
2412 * sqrt((double)lsn_age_factor)))
2413 / 700.5));
2414 default:
2415 ut_error;
2416 }
2405}2417}
24062418
2407/*********************************************************************//**2419/*********************************************************************//**
24082420
=== modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc'
--- Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-09-30 12:13:10 +0000
+++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-10-03 09:43:17 +0000
@@ -235,6 +235,21 @@
235 NULL235 NULL
236};236};
237237
238/** Possible values for system variable "innodb_cleaner_lsn_age_factor". */
239static const char* innodb_cleaner_lsn_age_factor_names[] = {
240 "legacy",
241 "high_checkpoint",
242 NullS
243};
244
245/** Enumeration for innodb_cleaner_lsn_age_factor. */
246static TYPELIB innodb_cleaner_lsn_age_factor_typelib = {
247 array_elements(innodb_cleaner_lsn_age_factor_names) - 1,
248 "innodb_cleaner_lsn_age_factor_typelib",
249 innodb_cleaner_lsn_age_factor_names,
250 NULL
251};
252
238/* The following counter is used to convey information to InnoDB253/* The following counter is used to convey information to InnoDB
239about server activity: in selects it is not sensible to call254about server activity: in selects it is not sensible to call
240srv_active_wake_master_thread after each fetch or search, we only do255srv_active_wake_master_thread after each fetch or search, we only do
@@ -16612,6 +16627,15 @@
1661216627
16613#endif /* defined UNIV_DEBUG || defined UNIV_PERF_DEBUG */16628#endif /* defined UNIV_DEBUG || defined UNIV_PERF_DEBUG */
1661416629
16630static MYSQL_SYSVAR_ENUM(cleaner_lsn_age_factor,
16631 srv_cleaner_lsn_age_factor,
16632 PLUGIN_VAR_OPCMDARG,
16633 "The formula for LSN age factor for page cleaner adaptive flushing. "
16634 "LEGACY: Original Oracle MySQL 5.6 formula. "
16635 "HIGH_CHECKPOINT: (the default) Percona Server 5.6 formula.",
16636 NULL, NULL, SRV_CLEANER_LSN_AGE_FACTOR_HIGH_CHECKPOINT,
16637 &innodb_cleaner_lsn_age_factor_typelib);
16638
16615static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances,16639static MYSQL_SYSVAR_LONG(buffer_pool_instances, innobase_buffer_pool_instances,
16616 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,16640 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
16617 "Number of buffer pool instances, set to higher value on high-end machines to increase scalability",16641 "Number of buffer pool instances, set to higher value on high-end machines to increase scalability",
@@ -17284,6 +17308,7 @@
17284 MYSQL_SYSVAR(cleaner_free_list_lwm),17308 MYSQL_SYSVAR(cleaner_free_list_lwm),
17285 MYSQL_SYSVAR(cleaner_eviction_factor),17309 MYSQL_SYSVAR(cleaner_eviction_factor),
17286#endif /* defined UNIV_DEBUG || defined UNIV_PERF_DEBUG */17310#endif /* defined UNIV_DEBUG || defined UNIV_PERF_DEBUG */
17311 MYSQL_SYSVAR(cleaner_lsn_age_factor),
17287 MYSQL_SYSVAR(print_all_deadlocks),17312 MYSQL_SYSVAR(print_all_deadlocks),
17288 MYSQL_SYSVAR(cmp_per_index_enabled),17313 MYSQL_SYSVAR(cmp_per_index_enabled),
17289 MYSQL_SYSVAR(undo_logs),17314 MYSQL_SYSVAR(undo_logs),
1729017315
=== modified file 'Percona-Server/storage/innobase/include/buf0types.h'
--- Percona-Server/storage/innobase/include/buf0types.h 2013-08-06 15:16:34 +0000
+++ Percona-Server/storage/innobase/include/buf0types.h 2013-10-03 09:43:17 +0000
@@ -92,6 +92,21 @@
92 when reading */92 when reading */
93};93};
9494
95/** Alternatives for srv_cleaner_lsn_age_factor, set through
96innodb_cleaner_lsn_age_factor variable */
97enum srv_cleaner_lsn_age_factor_t {
98 SRV_CLEANER_LSN_AGE_FACTOR_LEGACY, /*!< Original Oracle MySQL 5.6
99 formula */
100 SRV_CLEANER_LSN_AGE_FACTOR_HIGH_CHECKPOINT
101 /*!< Percona Server 5.6 formula
102 that returns lower values than
103 legacy option for low
104 checkpoint ages, and higher
105 values for high ages. This has
106 the effect of stabilizing the
107 checkpoint age higher. */
108};
109
95/** Parameters of binary buddy system for compressed pages (buf0buddy.h) */110/** Parameters of binary buddy system for compressed pages (buf0buddy.h) */
96/* @{ */111/* @{ */
97/** Zip shift value for the smallest page size */112/** Zip shift value for the smallest page size */
98113
=== modified file 'Percona-Server/storage/innobase/include/srv0srv.h'
--- Percona-Server/storage/innobase/include/srv0srv.h 2013-09-30 12:13:10 +0000
+++ Percona-Server/storage/innobase/include/srv0srv.h 2013-10-03 09:43:17 +0000
@@ -338,6 +338,10 @@
338 use evicted instead of flushed page338 use evicted instead of flushed page
339 counts for its heuristics */339 counts for its heuristics */
340340
341extern ulong srv_cleaner_lsn_age_factor;
342 /*!< page cleaner LSN age factor
343 formula option */
344
341extern ulint srv_n_file_io_threads;345extern ulint srv_n_file_io_threads;
342extern my_bool srv_random_read_ahead;346extern my_bool srv_random_read_ahead;
343extern ulong srv_read_ahead_threshold;347extern ulong srv_read_ahead_threshold;
344348
=== modified file 'Percona-Server/storage/innobase/srv/srv0srv.cc'
--- Percona-Server/storage/innobase/srv/srv0srv.cc 2013-09-30 12:13:10 +0000
+++ Percona-Server/storage/innobase/srv/srv0srv.cc 2013-10-03 09:43:17 +0000
@@ -286,6 +286,10 @@
286for its heuristics */286for its heuristics */
287UNIV_INTERN my_bool srv_cleaner_eviction_factor = FALSE;287UNIV_INTERN my_bool srv_cleaner_eviction_factor = FALSE;
288288
289/** Page cleaner LSN age factor formula option */
290UNIV_INTERN ulong srv_cleaner_lsn_age_factor
291 = SRV_CLEANER_LSN_AGE_FACTOR_HIGH_CHECKPOINT;
292
289/* This parameter is deprecated. Use srv_n_io_[read|write]_threads293/* This parameter is deprecated. Use srv_n_io_[read|write]_threads
290instead. */294instead. */
291UNIV_INTERN ulint srv_n_file_io_threads = ULINT_MAX;295UNIV_INTERN ulint srv_n_file_io_threads = ULINT_MAX;

Subscribers

People subscribed via source and target branches