1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-28 17:36:30 +03:00

MDEV-16125 Shutdown crash when innodb_force_recovery >= 2

Problem:
=======
InnoDB master thread encounters the shutdown state as SRV_SHUTDOWN_FLUSH_PHASE
when innodb_force_recovery >=2 and slow scheduling of master thread during
shutdown.

Fix:
====
There is no need for master thread itself if innodb_force_recovery >=2.
Don't create the master thread if innodb_force_recovery >= 2
This commit is contained in:
Thirunarayanan Balathandayuthapani
2018-05-09 19:00:30 +05:30
parent 0ea625b325
commit fe95cb2e40
2 changed files with 2 additions and 6 deletions

View File

@@ -2447,10 +2447,6 @@ DECLARE_THREAD(srv_master_thread)(
ut_a(slot == srv_sys.sys_threads);
loop:
if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
goto suspend_thread;
}
while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
srv_master_sleep();
@@ -2465,7 +2461,6 @@ loop:
}
}
suspend_thread:
switch (srv_shutdown_state) {
case SRV_SHUTDOWN_NONE:
break;

View File

@@ -2642,7 +2642,8 @@ files_checked:
/* Create the master thread which does purge and other utility
operations */
if (!srv_read_only_mode) {
if (!srv_read_only_mode
&& srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
thread_handles[1 + SRV_MAX_N_IO_THREADS] = os_thread_create(
srv_master_thread,
NULL, thread_ids + (1 + SRV_MAX_N_IO_THREADS));