mirror of
https://github.com/MariaDB/server.git
synced 2026-04-29 03:35:34 +02:00
Merge 10.0 to 10.1
This commit is contained in:
commit
4abc2dd0c7
5 changed files with 168 additions and 180 deletions
9
mysql-test/suite/innodb/r/drop_table_background.result
Normal file
9
mysql-test/suite/innodb/r/drop_table_background.result
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT,
|
||||
KEY(c1), KEY(c2), KEY(c2,c1),
|
||||
KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1),
|
||||
KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1),
|
||||
KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB;
|
||||
SET DEBUG_DBUG='+d,row_drop_table_add_to_background';
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (a INT) ENGINE=InnoDB;
|
||||
DROP TABLE t;
|
||||
30
mysql-test/suite/innodb/t/drop_table_background.test
Normal file
30
mysql-test/suite/innodb/t/drop_table_background.test
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
# Embedded server does not support restarting
|
||||
--source include/not_embedded.inc
|
||||
|
||||
CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT,
|
||||
KEY(c1), KEY(c2), KEY(c2,c1),
|
||||
KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1),
|
||||
KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1),
|
||||
KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB;
|
||||
|
||||
let $n= 10;
|
||||
|
||||
SET DEBUG_DBUG='+d,row_drop_table_add_to_background';
|
||||
--disable_query_log
|
||||
let $i= $n;
|
||||
while ($i) {
|
||||
eval CREATE TABLE t$i LIKE t;
|
||||
dec $i;
|
||||
}
|
||||
let $i= $n;
|
||||
while ($i) {
|
||||
eval DROP TABLE t$i;
|
||||
dec $i;
|
||||
}
|
||||
--enable_query_log
|
||||
DROP TABLE t;
|
||||
--source include/restart_mysqld.inc
|
||||
CREATE TABLE t (a INT) ENGINE=InnoDB;
|
||||
DROP TABLE t;
|
||||
|
|
@ -60,15 +60,22 @@ SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES}
|
|||
|
||||
# Gen_lex_token
|
||||
# Make sure sql_yacc.h is generated before compiling gen_lex_token
|
||||
|
||||
IF(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
SET(DEPENDS_gen_lex_token DEPENDS gen_lex_token)
|
||||
SET(DEPENDS_gen_lex_hash DEPENDS gen_lex_hash)
|
||||
ENDIF()
|
||||
|
||||
|
||||
IF(NOT CMAKE_CROSSCOMPILING)
|
||||
ADD_EXECUTABLE(gen_lex_token gen_lex_token.cc)
|
||||
ADD_DEPENDENCIES(gen_lex_token GenServerSource)
|
||||
ADD_EXECUTABLE(gen_lex_token gen_lex_token.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h)
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h
|
||||
COMMAND gen_lex_token > lex_token.h
|
||||
DEPENDS gen_lex_token
|
||||
${DEPENDS_gen_lex_token}
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER)
|
||||
|
|
@ -323,7 +330,7 @@ ENDIF()
|
|||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
|
||||
COMMAND gen_lex_hash > lex_hash.h
|
||||
DEPENDS gen_lex_hash
|
||||
${DEPENDS_gen_lex_hash}
|
||||
)
|
||||
|
||||
MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc COMPONENT Server)
|
||||
|
|
|
|||
|
|
@ -1835,7 +1835,7 @@ loop:
|
|||
}
|
||||
}
|
||||
|
||||
if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
goto exit_func;
|
||||
}
|
||||
|
||||
|
|
@ -1973,7 +1973,7 @@ loop:
|
|||
|
||||
os_event_wait_time_low(srv_error_event, 1000000, sig_count);
|
||||
|
||||
if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
|
||||
if (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
|
@ -2199,7 +2199,7 @@ srv_shutdown_print_master_pending(
|
|||
time_elapsed = ut_difftime(current_time, *last_print_time);
|
||||
|
||||
if (time_elapsed > 60) {
|
||||
*last_print_time = ut_time();
|
||||
*last_print_time = current_time;
|
||||
|
||||
if (n_tables_to_drop) {
|
||||
ut_print_timestamp(stderr);
|
||||
|
|
@ -2252,7 +2252,7 @@ srv_master_do_active_tasks(void)
|
|||
MONITOR_INC_TIME_IN_MICRO_SECS(
|
||||
MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND, counter_time);
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2286,11 +2286,7 @@ srv_master_do_active_tasks(void)
|
|||
MONITOR_SRV_MEM_VALIDATE_MICROSECOND, counter_time);
|
||||
}
|
||||
#endif
|
||||
if (srv_shutdown_state > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2303,7 +2299,7 @@ srv_master_do_active_tasks(void)
|
|||
MONITOR_SRV_DICT_LRU_MICROSECOND, counter_time);
|
||||
}
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2347,7 +2343,7 @@ srv_master_do_idle_tasks(void)
|
|||
MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND,
|
||||
counter_time);
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2363,7 +2359,7 @@ srv_master_do_idle_tasks(void)
|
|||
MONITOR_INC_TIME_IN_MICRO_SECS(
|
||||
MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time);
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2379,7 +2375,7 @@ srv_master_do_idle_tasks(void)
|
|||
MONITOR_INC_TIME_IN_MICRO_SECS(
|
||||
MONITOR_SRV_LOG_FLUSH_MICROSECOND, counter_time);
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2390,70 +2386,42 @@ srv_master_do_idle_tasks(void)
|
|||
counter_time);
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Perform the tasks during shutdown. The tasks that we do at shutdown
|
||||
depend on srv_fast_shutdown:
|
||||
2 => very fast shutdown => do no book keeping
|
||||
1 => normal shutdown => clear drop table queue and make checkpoint
|
||||
0 => slow shutdown => in addition to above do complete purge and ibuf
|
||||
merge
|
||||
@return TRUE if some work was done. FALSE otherwise */
|
||||
/** Perform shutdown tasks.
|
||||
@param[in] ibuf_merge whether to complete the change buffer merge */
|
||||
static
|
||||
ibool
|
||||
srv_master_do_shutdown_tasks(
|
||||
/*=========================*/
|
||||
ib_time_t* last_print_time)/*!< last time the function
|
||||
print the message */
|
||||
void
|
||||
srv_shutdown(bool ibuf_merge)
|
||||
{
|
||||
ulint n_bytes_merged = 0;
|
||||
ulint n_tables_to_drop = 0;
|
||||
ulint n_bytes_merged = 0;
|
||||
ulint n_tables_to_drop;
|
||||
ib_time_t now = ut_time();
|
||||
|
||||
ut_ad(!srv_read_only_mode);
|
||||
do {
|
||||
ut_ad(!srv_read_only_mode);
|
||||
ut_ad(srv_shutdown_state == SRV_SHUTDOWN_CLEANUP);
|
||||
++srv_main_shutdown_loops;
|
||||
|
||||
++srv_main_shutdown_loops;
|
||||
/* FIXME: Remove the background DROP TABLE queue; it is not
|
||||
crash-safe and breaks ACID. */
|
||||
srv_main_thread_op_info = "doing background drop tables";
|
||||
n_tables_to_drop = row_drop_tables_for_mysql_in_background();
|
||||
|
||||
ut_a(srv_shutdown_state > 0);
|
||||
if (ibuf_merge) {
|
||||
srv_main_thread_op_info = "checking free log space";
|
||||
log_free_check();
|
||||
srv_main_thread_op_info = "doing insert buffer merge";
|
||||
n_bytes_merged = ibuf_merge_in_background(true);
|
||||
|
||||
/* In very fast shutdown none of the following is necessary */
|
||||
if (srv_fast_shutdown == 2) {
|
||||
return(FALSE);
|
||||
}
|
||||
/* Flush logs if needed */
|
||||
srv_sync_log_buffer_in_background();
|
||||
}
|
||||
|
||||
/* ALTER TABLE in MySQL requires on Unix that the table handler
|
||||
can drop tables lazily after there no longer are SELECT
|
||||
queries to them. */
|
||||
srv_main_thread_op_info = "doing background drop tables";
|
||||
n_tables_to_drop = row_drop_tables_for_mysql_in_background();
|
||||
|
||||
/* make sure that there is enough reusable space in the redo
|
||||
log files */
|
||||
srv_main_thread_op_info = "checking free log space";
|
||||
log_free_check();
|
||||
|
||||
/* In case of normal shutdown we don't do ibuf merge or purge */
|
||||
if (srv_fast_shutdown == 1) {
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
/* Do an ibuf merge */
|
||||
srv_main_thread_op_info = "doing insert buffer merge";
|
||||
n_bytes_merged = ibuf_merge_in_background(true);
|
||||
|
||||
/* Flush logs if needed */
|
||||
srv_sync_log_buffer_in_background();
|
||||
|
||||
func_exit:
|
||||
/* Make a new checkpoint about once in 10 seconds */
|
||||
srv_main_thread_op_info = "making checkpoint";
|
||||
log_checkpoint(TRUE, FALSE);
|
||||
|
||||
/* Print progress message every 60 seconds during shutdown */
|
||||
if (srv_shutdown_state > 0 && srv_print_verbose_log) {
|
||||
srv_shutdown_print_master_pending(
|
||||
last_print_time, n_tables_to_drop, n_bytes_merged);
|
||||
}
|
||||
|
||||
return(n_bytes_merged || n_tables_to_drop);
|
||||
/* Print progress message every 60 seconds during shutdown */
|
||||
if (srv_print_verbose_log) {
|
||||
srv_shutdown_print_master_pending(
|
||||
&now, n_tables_to_drop, n_bytes_merged);
|
||||
}
|
||||
} while (n_bytes_merged || n_tables_to_drop);
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
|
|
@ -2485,7 +2453,6 @@ DECLARE_THREAD(srv_master_thread)(
|
|||
|
||||
srv_slot_t* slot;
|
||||
ulint old_activity_count = srv_get_activity_count();
|
||||
ib_time_t last_print_time;
|
||||
|
||||
ut_ad(!srv_read_only_mode);
|
||||
|
||||
|
|
@ -2504,7 +2471,6 @@ DECLARE_THREAD(srv_master_thread)(
|
|||
slot = srv_reserve_slot(SRV_MASTER);
|
||||
ut_a(slot == srv_sys.sys_threads);
|
||||
|
||||
last_print_time = ut_time();
|
||||
loop:
|
||||
if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
|
||||
goto suspend_thread;
|
||||
|
|
@ -2524,13 +2490,26 @@ loop:
|
|||
}
|
||||
}
|
||||
|
||||
while (srv_master_do_shutdown_tasks(&last_print_time)) {
|
||||
|
||||
/* Shouldn't loop here in case of very fast shutdown */
|
||||
ut_ad(srv_fast_shutdown < 2);
|
||||
suspend_thread:
|
||||
switch (srv_shutdown_state) {
|
||||
case SRV_SHUTDOWN_NONE:
|
||||
break;
|
||||
case SRV_SHUTDOWN_FLUSH_PHASE:
|
||||
case SRV_SHUTDOWN_LAST_PHASE:
|
||||
ut_ad(0);
|
||||
/* fall through */
|
||||
case SRV_SHUTDOWN_EXIT_THREADS:
|
||||
/* srv_init_abort() must have been invoked */
|
||||
case SRV_SHUTDOWN_CLEANUP:
|
||||
if (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP
|
||||
&& srv_fast_shutdown < 2) {
|
||||
srv_shutdown(srv_fast_shutdown == 1);
|
||||
}
|
||||
srv_suspend_thread(slot);
|
||||
my_thread_end();
|
||||
os_thread_exit(NULL);
|
||||
}
|
||||
|
||||
suspend_thread:
|
||||
srv_main_thread_op_info = "suspending";
|
||||
|
||||
srv_suspend_thread(slot);
|
||||
|
|
@ -2542,15 +2521,7 @@ suspend_thread:
|
|||
srv_main_thread_op_info = "waiting for server activity";
|
||||
|
||||
srv_resume_thread(slot);
|
||||
|
||||
if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
|
||||
my_thread_end();
|
||||
os_thread_exit(NULL);
|
||||
}
|
||||
|
||||
goto loop;
|
||||
|
||||
OS_THREAD_DUMMY_RETURN; /* Not reached, avoid compiler warning */
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
|
|
|
|||
|
|
@ -2280,7 +2280,7 @@ loop:
|
|||
}
|
||||
}
|
||||
|
||||
if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
goto exit_func;
|
||||
}
|
||||
|
||||
|
|
@ -2418,7 +2418,7 @@ loop:
|
|||
|
||||
os_event_wait_time_low(srv_error_event, 1000000, sig_count);
|
||||
|
||||
if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
|
||||
if (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
|
@ -2863,7 +2863,7 @@ srv_shutdown_print_master_pending(
|
|||
time_elapsed = ut_difftime(current_time, *last_print_time);
|
||||
|
||||
if (time_elapsed > 60) {
|
||||
*last_print_time = ut_time();
|
||||
*last_print_time = current_time;
|
||||
|
||||
if (n_tables_to_drop) {
|
||||
ut_print_timestamp(stderr);
|
||||
|
|
@ -2916,7 +2916,7 @@ srv_master_do_active_tasks(void)
|
|||
MONITOR_INC_TIME_IN_MICRO_SECS(
|
||||
MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND, counter_time);
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2950,11 +2950,7 @@ srv_master_do_active_tasks(void)
|
|||
MONITOR_SRV_MEM_VALIDATE_MICROSECOND, counter_time);
|
||||
}
|
||||
#endif
|
||||
if (srv_shutdown_state > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2967,7 +2963,7 @@ srv_master_do_active_tasks(void)
|
|||
MONITOR_SRV_DICT_LRU_MICROSECOND, counter_time);
|
||||
}
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3011,7 +3007,7 @@ srv_master_do_idle_tasks(void)
|
|||
MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND,
|
||||
counter_time);
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3027,7 +3023,7 @@ srv_master_do_idle_tasks(void)
|
|||
MONITOR_INC_TIME_IN_MICRO_SECS(
|
||||
MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time);
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3043,7 +3039,7 @@ srv_master_do_idle_tasks(void)
|
|||
MONITOR_INC_TIME_IN_MICRO_SECS(
|
||||
MONITOR_SRV_LOG_FLUSH_MICROSECOND, counter_time);
|
||||
|
||||
if (srv_shutdown_state > 0) {
|
||||
if (srv_shutdown_state != SRV_SHUTDOWN_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3064,70 +3060,42 @@ srv_master_do_idle_tasks(void)
|
|||
}
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Perform the tasks during shutdown. The tasks that we do at shutdown
|
||||
depend on srv_fast_shutdown:
|
||||
2 => very fast shutdown => do no book keeping
|
||||
1 => normal shutdown => clear drop table queue and make checkpoint
|
||||
0 => slow shutdown => in addition to above do complete purge and ibuf
|
||||
merge
|
||||
@return TRUE if some work was done. FALSE otherwise */
|
||||
/** Perform shutdown tasks.
|
||||
@param[in] ibuf_merge whether to complete the change buffer merge */
|
||||
static
|
||||
ibool
|
||||
srv_master_do_shutdown_tasks(
|
||||
/*=========================*/
|
||||
ib_time_t* last_print_time)/*!< last time the function
|
||||
print the message */
|
||||
void
|
||||
srv_shutdown(bool ibuf_merge)
|
||||
{
|
||||
ulint n_bytes_merged = 0;
|
||||
ulint n_tables_to_drop = 0;
|
||||
ulint n_bytes_merged = 0;
|
||||
ulint n_tables_to_drop;
|
||||
ib_time_t now = ut_time();
|
||||
|
||||
ut_ad(!srv_read_only_mode);
|
||||
do {
|
||||
ut_ad(!srv_read_only_mode);
|
||||
ut_ad(srv_shutdown_state == SRV_SHUTDOWN_CLEANUP);
|
||||
++srv_main_shutdown_loops;
|
||||
|
||||
++srv_main_shutdown_loops;
|
||||
/* FIXME: Remove the background DROP TABLE queue; it is not
|
||||
crash-safe and breaks ACID. */
|
||||
srv_main_thread_op_info = "doing background drop tables";
|
||||
n_tables_to_drop = row_drop_tables_for_mysql_in_background();
|
||||
|
||||
ut_a(srv_shutdown_state > 0);
|
||||
if (ibuf_merge) {
|
||||
srv_main_thread_op_info = "checking free log space";
|
||||
log_free_check();
|
||||
srv_main_thread_op_info = "doing insert buffer merge";
|
||||
n_bytes_merged = ibuf_merge_in_background(true);
|
||||
|
||||
/* In very fast shutdown none of the following is necessary */
|
||||
if (srv_fast_shutdown == 2) {
|
||||
return(FALSE);
|
||||
}
|
||||
/* Flush logs if needed */
|
||||
srv_sync_log_buffer_in_background();
|
||||
}
|
||||
|
||||
/* ALTER TABLE in MySQL requires on Unix that the table handler
|
||||
can drop tables lazily after there no longer are SELECT
|
||||
queries to them. */
|
||||
srv_main_thread_op_info = "doing background drop tables";
|
||||
n_tables_to_drop = row_drop_tables_for_mysql_in_background();
|
||||
|
||||
/* make sure that there is enough reusable space in the redo
|
||||
log files */
|
||||
srv_main_thread_op_info = "checking free log space";
|
||||
log_free_check();
|
||||
|
||||
/* In case of normal shutdown we don't do ibuf merge or purge */
|
||||
if (srv_fast_shutdown == 1) {
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
/* Do an ibuf merge */
|
||||
srv_main_thread_op_info = "doing insert buffer merge";
|
||||
n_bytes_merged = ibuf_merge_in_background(true);
|
||||
|
||||
/* Flush logs if needed */
|
||||
srv_sync_log_buffer_in_background();
|
||||
|
||||
func_exit:
|
||||
/* Make a new checkpoint about once in 10 seconds */
|
||||
srv_main_thread_op_info = "making checkpoint";
|
||||
log_checkpoint(TRUE, FALSE, FALSE);
|
||||
|
||||
/* Print progress message every 60 seconds during shutdown */
|
||||
if (srv_shutdown_state > 0 && srv_print_verbose_log) {
|
||||
srv_shutdown_print_master_pending(
|
||||
last_print_time, n_tables_to_drop, n_bytes_merged);
|
||||
}
|
||||
|
||||
return(n_bytes_merged || n_tables_to_drop);
|
||||
/* Print progress message every 60 seconds during shutdown */
|
||||
if (srv_print_verbose_log) {
|
||||
srv_shutdown_print_master_pending(
|
||||
&now, n_tables_to_drop, n_bytes_merged);
|
||||
}
|
||||
} while (n_bytes_merged || n_tables_to_drop);
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
|
|
@ -3161,7 +3129,6 @@ DECLARE_THREAD(srv_master_thread)(
|
|||
ulint old_activity_count = srv_get_activity_count();
|
||||
ulint old_ibuf_merge_activity_count
|
||||
= srv_get_ibuf_merge_activity_count();
|
||||
ib_time_t last_print_time;
|
||||
|
||||
ut_ad(!srv_read_only_mode);
|
||||
|
||||
|
|
@ -3184,7 +3151,6 @@ DECLARE_THREAD(srv_master_thread)(
|
|||
slot = srv_reserve_slot(SRV_MASTER);
|
||||
ut_a(slot == srv_sys.sys_threads);
|
||||
|
||||
last_print_time = ut_time();
|
||||
loop:
|
||||
if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) {
|
||||
goto suspend_thread;
|
||||
|
|
@ -3210,13 +3176,26 @@ loop:
|
|||
}
|
||||
}
|
||||
|
||||
while (srv_master_do_shutdown_tasks(&last_print_time)) {
|
||||
|
||||
/* Shouldn't loop here in case of very fast shutdown */
|
||||
ut_ad(srv_fast_shutdown < 2);
|
||||
suspend_thread:
|
||||
switch (srv_shutdown_state) {
|
||||
case SRV_SHUTDOWN_NONE:
|
||||
break;
|
||||
case SRV_SHUTDOWN_FLUSH_PHASE:
|
||||
case SRV_SHUTDOWN_LAST_PHASE:
|
||||
ut_ad(0);
|
||||
/* fall through */
|
||||
case SRV_SHUTDOWN_EXIT_THREADS:
|
||||
/* srv_init_abort() must have been invoked */
|
||||
case SRV_SHUTDOWN_CLEANUP:
|
||||
if (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP
|
||||
&& srv_fast_shutdown < 2) {
|
||||
srv_shutdown(srv_fast_shutdown == 1);
|
||||
}
|
||||
srv_suspend_thread(slot);
|
||||
my_thread_end();
|
||||
os_thread_exit(NULL);
|
||||
}
|
||||
|
||||
suspend_thread:
|
||||
srv_main_thread_op_info = "suspending";
|
||||
|
||||
srv_suspend_thread(slot);
|
||||
|
|
@ -3228,15 +3207,7 @@ suspend_thread:
|
|||
srv_main_thread_op_info = "waiting for server activity";
|
||||
|
||||
srv_resume_thread(slot);
|
||||
|
||||
if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
|
||||
my_thread_end();
|
||||
os_thread_exit(NULL);
|
||||
}
|
||||
|
||||
goto loop;
|
||||
|
||||
OS_THREAD_DUMMY_RETURN; /* Not reached, avoid compiler warning */
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue