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:
@@ -2447,10 +2447,6 @@ DECLARE_THREAD(srv_master_thread)(
|
|||||||
ut_a(slot == srv_sys.sys_threads);
|
ut_a(slot == srv_sys.sys_threads);
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
|
|
||||||
goto suspend_thread;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
|
while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
|
||||||
|
|
||||||
srv_master_sleep();
|
srv_master_sleep();
|
||||||
@@ -2465,7 +2461,6 @@ loop:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend_thread:
|
|
||||||
switch (srv_shutdown_state) {
|
switch (srv_shutdown_state) {
|
||||||
case SRV_SHUTDOWN_NONE:
|
case SRV_SHUTDOWN_NONE:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -2642,7 +2642,8 @@ files_checked:
|
|||||||
/* Create the master thread which does purge and other utility
|
/* Create the master thread which does purge and other utility
|
||||||
operations */
|
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(
|
thread_handles[1 + SRV_MAX_N_IO_THREADS] = os_thread_create(
|
||||||
srv_master_thread,
|
srv_master_thread,
|
||||||
NULL, thread_ids + (1 + SRV_MAX_N_IO_THREADS));
|
NULL, thread_ids + (1 + SRV_MAX_N_IO_THREADS));
|
||||||
|
|||||||
Reference in New Issue
Block a user