Commit de6cdc79 authored by bin.x.su@oracle.com's avatar bin.x.su@oracle.com

BUG 18117322 - DEFINE INNODB_THREAD_SLEEP_DELAY MAX VALUE

The maximum value for innodb_thread_sleep_delay is 4294967295 (32-bit) or
18446744073709551615 (64-bit) microseconds. This is way too big, since
the max value of innodb_thread_sleep_delay is limited by
innodb_adaptive_max_sleep_delay if that value is set to non-zero value
(its default is 150,000).

Solution
The maximum value of innodb_thread_sleep_delay should be the same as
the maximum value of innodb_adaptive_max_sleep_delay, which is 1000000.

Approved by Jimmy, rb#4429
parent 2bdffb1d
...@@ -41,6 +41,8 @@ set global innodb_thread_sleep_delay=1e1; ...@@ -41,6 +41,8 @@ set global innodb_thread_sleep_delay=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
set global innodb_thread_sleep_delay="foo"; set global innodb_thread_sleep_delay="foo";
ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay' ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
set global innodb_thread_sleep_delay=18446744073709551616;
ERROR 42000: Incorrect argument type to variable 'innodb_thread_sleep_delay'
set global innodb_thread_sleep_delay=-7; set global innodb_thread_sleep_delay=-7;
Warnings: Warnings:
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '-7' Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '-7'
...@@ -50,6 +52,34 @@ select @@global.innodb_thread_sleep_delay; ...@@ -50,6 +52,34 @@ select @@global.innodb_thread_sleep_delay;
select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay';
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
INNODB_THREAD_SLEEP_DELAY 0 INNODB_THREAD_SLEEP_DELAY 0
set global innodb_thread_sleep_delay=0;
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
0
set global innodb_thread_sleep_delay=1000;
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
1000
set global innodb_thread_sleep_delay=1000000;
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
1000000
set global innodb_thread_sleep_delay=1000001;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '1000001'
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
1000000
set global innodb_thread_sleep_delay=4294967295;
Warnings:
Warning 1292 Truncated incorrect innodb_thread_sleep_delay value: '4294967295'
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
1000000
set global innodb_thread_sleep_delay=555;
select @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay
555
SET @@global.innodb_thread_sleep_delay = @start_global_value; SET @@global.innodb_thread_sleep_delay = @start_global_value;
SELECT @@global.innodb_thread_sleep_delay; SELECT @@global.innodb_thread_sleep_delay;
@@global.innodb_thread_sleep_delay @@global.innodb_thread_sleep_delay
......
...@@ -40,11 +40,29 @@ set global innodb_thread_sleep_delay=1.1; ...@@ -40,11 +40,29 @@ set global innodb_thread_sleep_delay=1.1;
set global innodb_thread_sleep_delay=1e1; set global innodb_thread_sleep_delay=1e1;
--error ER_WRONG_TYPE_FOR_VAR --error ER_WRONG_TYPE_FOR_VAR
set global innodb_thread_sleep_delay="foo"; set global innodb_thread_sleep_delay="foo";
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_thread_sleep_delay=18446744073709551616;
set global innodb_thread_sleep_delay=-7; set global innodb_thread_sleep_delay=-7;
select @@global.innodb_thread_sleep_delay; select @@global.innodb_thread_sleep_delay;
select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay'; select * from information_schema.global_variables where variable_name='innodb_thread_sleep_delay';
#
# correct/overflowed values
#
set global innodb_thread_sleep_delay=0;
select @@global.innodb_thread_sleep_delay;
set global innodb_thread_sleep_delay=1000;
select @@global.innodb_thread_sleep_delay;
set global innodb_thread_sleep_delay=1000000;
select @@global.innodb_thread_sleep_delay;
set global innodb_thread_sleep_delay=1000001;
select @@global.innodb_thread_sleep_delay;
set global innodb_thread_sleep_delay=4294967295;
select @@global.innodb_thread_sleep_delay;
set global innodb_thread_sleep_delay=555;
select @@global.innodb_thread_sleep_delay;
# #
# cleanup # cleanup
# #
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc. Copyright (c) 2009, Percona Inc.
...@@ -11694,7 +11694,7 @@ static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency, ...@@ -11694,7 +11694,7 @@ static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency,
static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay, static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay,
PLUGIN_VAR_RQCMDARG, PLUGIN_VAR_RQCMDARG,
"Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep", "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep",
NULL, NULL, 10000L, 0L, ~0UL, 0); NULL, NULL, 10000L, 0L, 1000000L, 0);
static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path, static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
......
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