Commit 0f322994 authored by Jan Lindström's avatar Jan Lindström

MDEV-7035: Remove innodb_io_capacity setting depending on

setting of innodb_io_capacity_max

(a) Changed the behaviour so that if you set innodb_io_capacity to a 
value > innodb_io_capacity_max that the value is accepted AND 
that innodb_io_capacity_max = innodb_io_capacity * 2.

(b) If someone wants to reduce innodb_io_capacity_max and 
reduce it below innodb_io_capacity then innodb_io_capacity 
should be reduced to the same level as innodb_io_capacity_max.

In both cases give a warning to user.
parent bff2d46b
......@@ -45,27 +45,42 @@ set global innodb_io_capacity_max=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_io_capacity_max'
set global innodb_io_capacity_max="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_io_capacity_max'
set global innodb_io_capacity_max=@start_innodb_capacity - 1;
set global innodb_io_capacity_max=1000;
set global innodb_io_capacity=500;
set global innodb_io_capacity_max=400;
Warnings:
Warning 1210 innodb_io_capacity_max cannot be set lower than innodb_io_capacity.
Warning 1210 Setting innodb_io_capacity_max to 200
Warning 1210 Setting innodb_io_capacity_max 400 lower than innodb_io_capacity 500.
Warning 1210 Setting innodb_io_capacity to 400
select @@global.innodb_io_capacity_max;
@@global.innodb_io_capacity_max
200
400
select @@global.innodb_io_capacity;
@@global.innodb_io_capacity
400
select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
VARIABLE_NAME VARIABLE_VALUE
INNODB_IO_CAPACITY_MAX 200
set global innodb_io_capacity_max=-7;
INNODB_IO_CAPACITY_MAX 400
select * from information_schema.global_variables where variable_name='innodb_io_capacity';
VARIABLE_NAME VARIABLE_VALUE
INNODB_IO_CAPACITY 400
set global innodb_io_capacity_max=1000;
set global innodb_io_capacity=500;
set global innodb_io_capacity=1400;
Warnings:
Warning 1292 Truncated incorrect innodb_io_capacity_max value: '-7'
Warning 1210 innodb_io_capacity_max cannot be set lower than innodb_io_capacity.
Warning 1210 Setting innodb_io_capacity_max to 200
Warning 1210 Setting innodb_io_capacity to 1400 higher than innodb_io_capacity_max 1000
Warning 1210 Setting innodb_max_io_capacity to 2800
select @@global.innodb_io_capacity_max;
@@global.innodb_io_capacity_max
200
2800
select @@global.innodb_io_capacity;
@@global.innodb_io_capacity
1400
select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
VARIABLE_NAME VARIABLE_VALUE
INNODB_IO_CAPACITY_MAX 200
INNODB_IO_CAPACITY_MAX 2800
select * from information_schema.global_variables where variable_name='innodb_io_capacity';
VARIABLE_NAME VARIABLE_VALUE
INNODB_IO_CAPACITY 1400
set global innodb_io_capacity=100;
set global innodb_io_capacity_max=100;
select @@global.innodb_io_capacity_max;
......
......@@ -25,7 +25,7 @@ select * from information_schema.global_variables where variable_name='innodb_io
select * from information_schema.session_variables where variable_name='innodb_io_capacity_max';
#
# show that it's writable. Allowed value cannot be lower than innodb_io_capacity
# show that it's writable.
#
set global innodb_io_capacity_max=@start_innodb_capacity + 1;
select @@global.innodb_io_capacity_max;
......@@ -45,15 +45,26 @@ set global innodb_io_capacity_max=1e1;
set global innodb_io_capacity_max="foo";
#
# can't set it below innodb_io_capacity
# Setting io_capacity_max lower than io_capacity affects also io_capacity
#
set global innodb_io_capacity_max=@start_innodb_capacity - 1;
set global innodb_io_capacity_max=1000;
set global innodb_io_capacity=500;
set global innodb_io_capacity_max=400;
select @@global.innodb_io_capacity_max;
select @@global.innodb_io_capacity;
select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
set global innodb_io_capacity_max=-7;
select * from information_schema.global_variables where variable_name='innodb_io_capacity';
#
# Setting io_capacity higher than io_capacity_max affects also io_capacity_max
#
set global innodb_io_capacity_max=1000;
set global innodb_io_capacity=500;
set global innodb_io_capacity=1400;
select @@global.innodb_io_capacity_max;
select @@global.innodb_io_capacity;
select * from information_schema.global_variables where variable_name='innodb_io_capacity_max';
select * from information_schema.global_variables where variable_name='innodb_io_capacity';
#
# min/max values
#
......
......@@ -14235,14 +14235,17 @@ innodb_io_capacity_max_update(
{
ulong in_val = *static_cast<const ulong*>(save);
if (in_val < srv_io_capacity) {
in_val = srv_io_capacity;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
"innodb_io_capacity_max cannot be"
" set lower than innodb_io_capacity.");
"Setting innodb_io_capacity_max %lu"
" lower than innodb_io_capacity %lu.",
in_val, srv_io_capacity);
srv_io_capacity = in_val;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
"Setting innodb_io_capacity_max to %lu",
"Setting innodb_io_capacity to %lu",
srv_io_capacity);
}
......@@ -14265,15 +14268,19 @@ innodb_io_capacity_update(
from check function */
{
ulong in_val = *static_cast<const ulong*>(save);
if (in_val > srv_max_io_capacity) {
in_val = srv_max_io_capacity;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
"innodb_io_capacity cannot be set"
" higher than innodb_io_capacity_max.");
"Setting innodb_io_capacity to %lu"
" higher than innodb_io_capacity_max %lu",
in_val, srv_max_io_capacity);
srv_max_io_capacity = in_val * 2;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
"Setting innodb_io_capacity to %lu",
"Setting innodb_max_io_capacity to %lu",
srv_max_io_capacity);
}
......
......@@ -14966,14 +14966,17 @@ innodb_io_capacity_max_update(
{
ulong in_val = *static_cast<const ulong*>(save);
if (in_val < srv_io_capacity) {
in_val = srv_io_capacity;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
"innodb_io_capacity_max cannot be"
" set lower than innodb_io_capacity.");
"Setting innodb_io_capacity_max %lu"
" lower than innodb_io_capacity %lu.",
in_val, srv_io_capacity);
srv_io_capacity = in_val;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
"Setting innodb_io_capacity_max to %lu",
"Setting innodb_io_capacity to %lu",
srv_io_capacity);
}
......@@ -14997,14 +15000,18 @@ innodb_io_capacity_update(
{
ulong in_val = *static_cast<const ulong*>(save);
if (in_val > srv_max_io_capacity) {
in_val = srv_max_io_capacity;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
"innodb_io_capacity cannot be set"
" higher than innodb_io_capacity_max.");
"Setting innodb_io_capacity to %lu"
" higher than innodb_io_capacity_max %lu",
in_val, srv_max_io_capacity);
srv_max_io_capacity = in_val * 2;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
"Setting innodb_io_capacity to %lu",
"Setting innodb_max_io_capacity to %lu",
srv_max_io_capacity);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment