Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
19e76814
Commit
19e76814
authored
Apr 05, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clarify/simplify new innodb sysvars: innodb-scrub-log-interval
rename to innodb-scrub-log-speed
parent
72c8b3fc
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
103 additions
and
113 deletions
+103
-113
mysql-test/suite/sys_vars/r/innodb_scrub_log_interval_basic.result
...t/suite/sys_vars/r/innodb_scrub_log_interval_basic.result
+0
-53
mysql-test/suite/sys_vars/r/innodb_scrub_log_speed_basic.result
...test/suite/sys_vars/r/innodb_scrub_log_speed_basic.result
+53
-0
mysql-test/suite/sys_vars/r/sysvars_innodb.result
mysql-test/suite/sys_vars/r/sysvars_innodb.result
+6
-6
mysql-test/suite/sys_vars/t/innodb_scrub_log_speed_basic.test
...l-test/suite/sys_vars/t/innodb_scrub_log_speed_basic.test
+16
-16
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+6
-14
storage/innobase/include/log0log.h
storage/innobase/include/log0log.h
+2
-2
storage/innobase/log/log0log.cc
storage/innobase/log/log0log.cc
+6
-3
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+6
-14
storage/xtradb/include/log0log.h
storage/xtradb/include/log0log.h
+2
-2
storage/xtradb/log/log0log.cc
storage/xtradb/log/log0log.cc
+6
-3
No files found.
mysql-test/suite/sys_vars/r/innodb_scrub_log_interval_basic.result
deleted
100644 → 0
View file @
72c8b3fc
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
2000
200 Expected
SET @@GLOBAL.innodb_scrub_log_interval=100;
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
100
100 Expected
SET @@GLOBAL.innodb_scrub_log_interval=DEFAULT;
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
2000
200 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log_interval';
@@GLOBAL.innodb_scrub_log_interval = VARIABLE_VALUE
1
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
2000
200 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log_interval';
VARIABLE_VALUE
2000
200 Expected
SELECT @@innodb_scrub_log_interval = @@GLOBAL.innodb_scrub_log_interval;
@@innodb_scrub_log_interval = @@GLOBAL.innodb_scrub_log_interval
1
1 Expected
SELECT @@innodb_scrub_log_interval;
@@innodb_scrub_log_interval
2000
200 Expected
SELECT @@local.innodb_scrub_log_interval;
ERROR HY000: Variable 'innodb_scrub_log_interval' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@SESSION.innodb_scrub_log_interval;
ERROR HY000: Variable 'innodb_scrub_log_interval' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_scrub_log_interval;
@@GLOBAL.innodb_scrub_log_interval
2000
200 Expected
SELECT innodb_scrub_log_interval;
ERROR 42S22: Unknown column 'innodb_scrub_log_interval' in 'field list'
Expected error 'Unknow column in field list'
mysql-test/suite/sys_vars/r/innodb_scrub_log_speed_basic.result
0 → 100644
View file @
19e76814
SELECT @@GLOBAL.innodb_scrub_log_speed;
@@GLOBAL.innodb_scrub_log_speed
256
200 Expected
SET @@GLOBAL.innodb_scrub_log_speed=100;
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_speed;
@@GLOBAL.innodb_scrub_log_speed
100
100 Expected
SET @@GLOBAL.innodb_scrub_log_speed=DEFAULT;
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_speed;
@@GLOBAL.innodb_scrub_log_speed
256
200 Expected
SELECT @@GLOBAL.innodb_scrub_log_speed = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log_speed';
@@GLOBAL.innodb_scrub_log_speed = VARIABLE_VALUE
1
1 Expected
SELECT @@GLOBAL.innodb_scrub_log_speed;
@@GLOBAL.innodb_scrub_log_speed
256
200 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_scrub_log_speed';
VARIABLE_VALUE
256
200 Expected
SELECT @@innodb_scrub_log_speed = @@GLOBAL.innodb_scrub_log_speed;
@@innodb_scrub_log_speed = @@GLOBAL.innodb_scrub_log_speed
1
1 Expected
SELECT @@innodb_scrub_log_speed;
@@innodb_scrub_log_speed
256
200 Expected
SELECT @@local.innodb_scrub_log_speed;
ERROR HY000: Variable 'innodb_scrub_log_speed' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@SESSION.innodb_scrub_log_speed;
ERROR HY000: Variable 'innodb_scrub_log_speed' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT @@GLOBAL.innodb_scrub_log_speed;
@@GLOBAL.innodb_scrub_log_speed
256
200 Expected
SELECT innodb_scrub_log_speed;
ERROR 42S22: Unknown column 'innodb_scrub_log_speed' in 'field list'
Expected error 'Unknow column in field list'
mysql-test/suite/sys_vars/r/sysvars_innodb.result
View file @
19e76814
...
...
@@ -1867,16 +1867,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_SCRUB_LOG_
INTERVAL
VARIABLE_NAME INNODB_SCRUB_LOG_
SPEED
SESSION_VALUE NULL
GLOBAL_VALUE 2
000
GLOBAL_VALUE 2
56
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 2
000
DEFAULT_VALUE 2
56
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT
Innodb redo log scrubbing interval in ms
NUMERIC_MIN_VALUE 1
0
NUMERIC_MAX_VALUE
18446744073709551615
VARIABLE_COMMENT
Background redo log scrubbing speed in bytes/sec
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE
50000
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
...
...
mysql-test/suite/sys_vars/t/innodb_scrub_log_
interval
_basic.test
→
mysql-test/suite/sys_vars/t/innodb_scrub_log_
speed
_basic.test
View file @
19e76814
--
source
include
/
have_innodb
.
inc
# Display default value
SELECT
@@
GLOBAL
.
innodb_scrub_log_
interval
;
SELECT
@@
GLOBAL
.
innodb_scrub_log_
speed
;
--
echo
200
Expected
# Check if value can be set
SET
@@
GLOBAL
.
innodb_scrub_log_
interval
=
100
;
SET
@@
GLOBAL
.
innodb_scrub_log_
speed
=
100
;
--
echo
1
Expected
SELECT
@@
GLOBAL
.
innodb_scrub_log_
interval
;
SELECT
@@
GLOBAL
.
innodb_scrub_log_
speed
;
--
echo
100
Expected
SET
@@
GLOBAL
.
innodb_scrub_log_
interval
=
DEFAULT
;
SET
@@
GLOBAL
.
innodb_scrub_log_
speed
=
DEFAULT
;
--
echo
1
Expected
SELECT
@@
GLOBAL
.
innodb_scrub_log_
interval
;
SELECT
@@
GLOBAL
.
innodb_scrub_log_
speed
;
--
echo
200
Expected
# Check if the value in GLOBAL TABLE matches value in variable
SELECT
@@
GLOBAL
.
innodb_scrub_log_
interval
=
VARIABLE_VALUE
SELECT
@@
GLOBAL
.
innodb_scrub_log_
speed
=
VARIABLE_VALUE
FROM
INFORMATION_SCHEMA
.
GLOBAL_VARIABLES
WHERE
VARIABLE_NAME
=
'innodb_scrub_log_
interval
'
;
WHERE
VARIABLE_NAME
=
'innodb_scrub_log_
speed
'
;
--
echo
1
Expected
SELECT
@@
GLOBAL
.
innodb_scrub_log_
interval
;
SELECT
@@
GLOBAL
.
innodb_scrub_log_
speed
;
--
echo
200
Expected
SELECT
VARIABLE_VALUE
FROM
INFORMATION_SCHEMA
.
GLOBAL_VARIABLES
WHERE
VARIABLE_NAME
=
'innodb_scrub_log_
interval
'
;
WHERE
VARIABLE_NAME
=
'innodb_scrub_log_
speed
'
;
--
echo
200
Expected
# Check if accessing variable with and without GLOBAL point to same variable
SELECT
@@
innodb_scrub_log_
interval
=
@@
GLOBAL
.
innodb_scrub_log_interval
;
SELECT
@@
innodb_scrub_log_
speed
=
@@
GLOBAL
.
innodb_scrub_log_speed
;
--
echo
1
Expected
# Check if innodb_scrub_log_
interval
can be accessed with and without @@ sign
SELECT
@@
innodb_scrub_log_
interval
;
# Check if innodb_scrub_log_
speed
can be accessed with and without @@ sign
SELECT
@@
innodb_scrub_log_
speed
;
--
echo
200
Expected
--
Error
ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT
@@
local
.
innodb_scrub_log_
interval
;
SELECT
@@
local
.
innodb_scrub_log_
speed
;
--
echo
Expected
error
'Variable is a GLOBAL variable'
--
Error
ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT
@@
SESSION
.
innodb_scrub_log_
interval
;
SELECT
@@
SESSION
.
innodb_scrub_log_
speed
;
--
echo
Expected
error
'Variable is a GLOBAL variable'
SELECT
@@
GLOBAL
.
innodb_scrub_log_
interval
;
SELECT
@@
GLOBAL
.
innodb_scrub_log_
speed
;
--
echo
200
Expected
--
Error
ER_BAD_FIELD_ERROR
SELECT
innodb_scrub_log_
interval
;
SELECT
innodb_scrub_log_
speed
;
--
echo
Expected
error
'Unknow column in field list'
storage/innobase/handler/ha_innodb.cc
View file @
19e76814
...
...
@@ -19163,21 +19163,13 @@ static MYSQL_SYSVAR_BOOL(scrub_log, srv_scrub_log,
"Enable redo log scrubbing"
,
0
,
0
,
0
);
/*
If innodb_scrub_log is on, logs will be scrubbed in less than
(((innodb_log_file_size * innodb_log_files_in_group) / 512 ) /
((1000 * 86400) / innodb_scrub_log_interval))
days.
In above formula, the first line calculates the number of log blocks to scrub,
and the second line calculates the number of log blocks scrubbed in one day.
*/
static
MYSQL_SYSVAR_ULONGLONG
(
scrub_log_interval
,
innodb_scrub_log_interval
,
static
MYSQL_SYSVAR_ULONGLONG
(
scrub_log_speed
,
innodb_scrub_log_speed
,
PLUGIN_VAR_OPCMDARG
,
"
Innodb redo log scrubbing interval in ms
"
,
"
Background redo log scrubbing speed in bytes/sec
"
,
NULL
,
NULL
,
2
000
,
/* default
*/
1
0
,
/* min */
ULONGLONG_MAX
,
0
);
/* max
*/
2
56
,
/* 256 bytes/sec, corresponds to 2000 ms scrub_log_interval
*/
1
,
/* min */
50000
,
0
);
/* 50Kbyte/sec, corresponds to 10 ms scrub_log_interval
*/
static
MYSQL_SYSVAR_BOOL
(
encrypt_log
,
srv_encrypt_log
,
PLUGIN_VAR_OPCMDARG
|
PLUGIN_VAR_READONLY
,
...
...
@@ -19423,7 +19415,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR
(
encryption_rotate_key_age
),
MYSQL_SYSVAR
(
encryption_rotation_iops
),
MYSQL_SYSVAR
(
scrub_log
),
MYSQL_SYSVAR
(
scrub_log_
interval
),
MYSQL_SYSVAR
(
scrub_log_
speed
),
MYSQL_SYSVAR
(
encrypt_log
),
MYSQL_SYSVAR
(
default_page_encryption_key
),
...
...
storage/innobase/include/log0log.h
View file @
19e76814
...
...
@@ -1022,8 +1022,8 @@ struct log_t{
#endif
/* UNIV_LOG_ARCHIVE */
extern
os_event_t
log_scrub_event
;
/* log scrubbing
interval in ms
*/
extern
ulonglong
innodb_scrub_log_
interval
;
/* log scrubbing
speed, in bytes/sec
*/
extern
ulonglong
innodb_scrub_log_
speed
;
/*****************************************************************//**
This is the main thread for log scrub. It waits for an event and
...
...
storage/innobase/log/log0log.cc
View file @
19e76814
...
...
@@ -3857,8 +3857,8 @@ log_scrub()
next_lbn_to_pad
=
log_block_convert_lsn_to_no
(
log_sys
->
lsn
);
}
/* log scrubbing
interval in ms.
*/
UNIV_INTERN
ulonglong
innodb_scrub_log_
interval
;
/* log scrubbing
speed, in bytes/sec
*/
UNIV_INTERN
ulonglong
innodb_scrub_log_
speed
;
/*****************************************************************//**
This is the main thread for log scrub. It waits for an event and
...
...
@@ -3878,7 +3878,10 @@ DECLARE_THREAD(log_scrub_thread)(
while
(
srv_shutdown_state
==
SRV_SHUTDOWN_NONE
)
{
os_event_wait_time
(
log_scrub_event
,
innodb_scrub_log_interval
*
1000
);
/* log scrubbing interval in µs. */
ulonglong
interval
=
1000
*
1000
*
512
/
innodb_scrub_log_speed
;
os_event_wait_time
(
log_scrub_event
,
interval
);
log_scrub
();
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
19e76814
...
...
@@ -20346,21 +20346,13 @@ static MYSQL_SYSVAR_BOOL(scrub_log, srv_scrub_log,
"Enable redo log scrubbing"
,
0
,
0
,
0
);
/*
If innodb_scrub_log is on, logs will be scrubbed in less than
(((innodb_log_file_size * innodb_log_files_in_group) / 512 ) /
((1000 * 86400) / innodb_scrub_log_interval))
days.
In above formula, the first line calculates the number of log blocks to scrub,
and the second line calculates the number of log blocks scrubbed in one day.
*/
static
MYSQL_SYSVAR_ULONGLONG
(
scrub_log_interval
,
innodb_scrub_log_interval
,
static
MYSQL_SYSVAR_ULONGLONG
(
scrub_log_speed
,
innodb_scrub_log_speed
,
PLUGIN_VAR_OPCMDARG
,
"
Innodb redo log scrubbing interval in ms
"
,
"
Background redo log scrubbing speed in bytes/sec
"
,
NULL
,
NULL
,
2
000
,
/* default
*/
1
0
,
/* min */
ULONGLONG_MAX
,
0
);
/* max
*/
2
56
,
/* 256 bytes/sec, corresponds to 2000 ms scrub_log_interval
*/
1
,
/* min */
50000
,
0
);
/* 50Kbyte/sec, corresponds to 10 ms scrub_log_interval
*/
static
MYSQL_SYSVAR_BOOL
(
encrypt_log
,
srv_encrypt_log
,
PLUGIN_VAR_OPCMDARG
|
PLUGIN_VAR_READONLY
,
...
...
@@ -20644,7 +20636,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR
(
encryption_rotate_key_age
),
MYSQL_SYSVAR
(
encryption_rotation_iops
),
MYSQL_SYSVAR
(
scrub_log
),
MYSQL_SYSVAR
(
scrub_log_
interval
),
MYSQL_SYSVAR
(
scrub_log_
speed
),
MYSQL_SYSVAR
(
encrypt_log
),
MYSQL_SYSVAR
(
default_page_encryption_key
),
/* Scrubing feature */
...
...
storage/xtradb/include/log0log.h
View file @
19e76814
...
...
@@ -1101,8 +1101,8 @@ struct log_t{
#endif
/* UNIV_LOG_ARCHIVE */
extern
os_event_t
log_scrub_event
;
/* log scrubbing
interval in ms
*/
extern
ulonglong
innodb_scrub_log_
interval
;
/* log scrubbing
speed, in bytes/sec
*/
extern
ulonglong
innodb_scrub_log_
speed
;
/*****************************************************************//**
This is the main thread for log scrub. It waits for an event and
...
...
storage/xtradb/log/log0log.cc
View file @
19e76814
...
...
@@ -4187,8 +4187,8 @@ log_scrub()
next_lbn_to_pad
=
log_block_convert_lsn_to_no
(
log_sys
->
lsn
);
}
/* log scrubbing
interval in ms.
*/
UNIV_INTERN
ulonglong
innodb_scrub_log_
interval
;
/* log scrubbing
speed, in bytes/sec
*/
UNIV_INTERN
ulonglong
innodb_scrub_log_
speed
;
/*****************************************************************//**
This is the main thread for log scrub. It waits for an event and
...
...
@@ -4208,7 +4208,10 @@ DECLARE_THREAD(log_scrub_thread)(
while
(
srv_shutdown_state
==
SRV_SHUTDOWN_NONE
)
{
os_event_wait_time
(
log_scrub_event
,
innodb_scrub_log_interval
*
1000
);
/* log scrubbing interval in µs. */
ulonglong
interval
=
1000
*
1000
*
512
/
innodb_scrub_log_speed
;
os_event_wait_time
(
log_scrub_event
,
interval
);
log_scrub
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment