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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
dd67456a
Commit
dd67456a
authored
Aug 11, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB: disallow fast_shutdown=0 when purge threads have exited
parent
fc279d7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
1 deletion
+37
-1
mysql-test/suite/innodb/r/purge_thread_shutdown.result
mysql-test/suite/innodb/r/purge_thread_shutdown.result
+2
-0
mysql-test/suite/innodb/t/purge_thread_shutdown.test
mysql-test/suite/innodb/t/purge_thread_shutdown.test
+2
-0
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+33
-1
No files found.
mysql-test/suite/innodb/r/purge_thread_shutdown.result
View file @
dd67456a
...
...
@@ -15,6 +15,8 @@ shutdown;
connection default;
disconnect con1;
delete from t1 where a=3;
set global innodb_fast_shutdown=0;
ERROR 42000: Variable 'innodb_fast_shutdown' can't be set to the value of '0'
kill ID;
ERROR 70100: Connection was killed
drop table t1;
mysql-test/suite/innodb/t/purge_thread_shutdown.test
View file @
dd67456a
...
...
@@ -24,6 +24,8 @@ let $wait_condition=select count(*) = 0 from information_schema.processlist wher
source
include
/
wait_condition
.
inc
;
delete
from
t1
where
a
=
3
;
--
error
ER_WRONG_VALUE_FOR_VAR
set
global
innodb_fast_shutdown
=
0
;
let
$me
=
`select connection_id()`
;
replace_result
$me
ID
;
...
...
storage/innobase/handler/ha_innodb.cc
View file @
dd67456a
...
...
@@ -723,6 +723,7 @@ static PSI_file_info all_innodb_files[] = {
static
void
innodb_remember_check_sysvar_funcs
();
mysql_var_check_func
check_sysvar_enum
;
mysql_var_check_func
check_sysvar_int
;
// should page compression be used by default for new tables
static
MYSQL_THDVAR_BOOL
(
compression_default
,
PLUGIN_VAR_OPCMDARG
,
...
...
@@ -18286,6 +18287,34 @@ innodb_file_format_name_validate(
return
(
1
);
}
/*************************************************************//**
Don't allow to set innodb_fast_shutdown=0 if purge threads are
already down.
@return 0 if innodb_fast_shutdown can be set */
static
int
fast_shutdown_validate
(
/*=============================*/
THD
*
thd
,
/*!< in: thread handle */
struct
st_mysql_sys_var
*
var
,
/*!< in: pointer to system
variable */
void
*
save
,
/*!< out: immediate result
for update function */
struct
st_mysql_value
*
value
)
/*!< in: incoming string */
{
if
(
check_sysvar_int
(
thd
,
var
,
save
,
value
))
{
return
(
1
);
}
uint
new_val
=
*
reinterpret_cast
<
uint
*>
(
save
);
if
(
srv_fast_shutdown
&&
!
new_val
&&
!
srv_running
)
{
return
(
1
);
}
return
(
0
);
}
/****************************************************************//**
Update the system variable innodb_file_format using the "saved"
value. This function is registered as a callback with MySQL. */
...
...
@@ -20628,7 +20657,7 @@ static MYSQL_SYSVAR_UINT(fast_shutdown, srv_fast_shutdown,
PLUGIN_VAR_OPCMDARG
,
"Speeds up the shutdown process of the InnoDB storage engine. Possible"
" values are 0, 1 (faster) or 2 (fastest - crash-like)."
,
NULL
,
NULL
,
1
,
0
,
2
,
0
);
fast_shutdown_validate
,
NULL
,
1
,
0
,
2
,
0
);
static
MYSQL_SYSVAR_BOOL
(
file_per_table
,
srv_file_per_table
,
PLUGIN_VAR_NOCMDARG
,
...
...
@@ -22924,6 +22953,9 @@ static void innodb_remember_check_sysvar_funcs()
/* remember build-in sysvar check functions */
ut_ad
((
MYSQL_SYSVAR_NAME
(
checksum_algorithm
).
flags
&
0x1FF
)
==
PLUGIN_VAR_ENUM
);
check_sysvar_enum
=
MYSQL_SYSVAR_NAME
(
checksum_algorithm
).
check
;
ut_ad
((
MYSQL_SYSVAR_NAME
(
flush_log_at_timeout
).
flags
&
15
)
==
PLUGIN_VAR_INT
);
check_sysvar_int
=
MYSQL_SYSVAR_NAME
(
flush_log_at_timeout
).
check
;
}
/********************************************************************//**
...
...
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