From 88d89ee0bae24b71416c2af4f4c2f2be7b6a033a Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Sat, 9 Mar 2019 19:48:11 +0400 Subject: [PATCH] Less abort_loop references Removed redundant initialisation in unireg_init(): already done by mysql_init_variables(). Slave threads already check THD::killed, which eliminates the need to check abort_loop. Removed unused wsrep_kill_mysql(). --- sql/init.cc | 4 +--- sql/slave.cc | 6 +++--- sql/slave.h | 1 - sql/wsrep_mysqld.cc | 16 ---------------- sql/wsrep_mysqld.h | 1 - 5 files changed, 4 insertions(+), 24 deletions(-) diff --git a/sql/init.cc b/sql/init.cc index 0d00e3cf846..024cbb79d81 100644 --- a/sql/init.cc +++ b/sql/init.cc @@ -24,7 +24,7 @@ #include "mariadb.h" #include "sql_priv.h" #include "init.h" -#include "mysqld.h" // abort_loop, ... +#include "mysqld.h" #include "my_time.h" // my_init_time #include "unireg.h" // SPECIAL_SAME_DB_NAME #include @@ -34,8 +34,6 @@ void unireg_init(ulong options) DBUG_ENTER("unireg_init"); error_handler_hook = my_message_stderr; - abort_loop=0; - my_disable_async_io=1; /* aioread is only in shared library */ wild_many='%'; wild_one='_'; wild_prefix='\\'; /* Change to sql syntax */ diff --git a/sql/slave.cc b/sql/slave.cc index 17a63e94661..f5bfd0f1974 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -510,7 +510,7 @@ handle_slave_background(void *arg __attribute__((unused))) &old_stage); for (;;) { - stop= abort_loop || thd->killed || slave_background_thread_stop; + stop= thd->killed || slave_background_thread_stop; kill_list= slave_background_kill_list; create_list= slave_background_gtid_pos_create_list; pending_deletes= slave_background_gtid_pending_delete_flag; @@ -1474,7 +1474,7 @@ static bool io_slave_killed(Master_info* mi) DBUG_ENTER("io_slave_killed"); DBUG_ASSERT(mi->slave_running); // tracking buffer overrun - DBUG_RETURN(mi->abort_slave || abort_loop || mi->io_thd->killed); + DBUG_RETURN(mi->abort_slave || mi->io_thd->killed); } /** @@ -1499,7 +1499,7 @@ static bool sql_slave_killed(rpl_group_info *rgi) DBUG_ASSERT(rli->sql_driver_thd == thd); DBUG_ASSERT(rli->slave_running == 1);// tracking buffer overrun - if (abort_loop || rli->sql_driver_thd->killed || rli->abort_slave) + if (rli->sql_driver_thd->killed || rli->abort_slave) { /* The transaction should always be binlogged if OPTION_KEEP_LOG is diff --git a/sql/slave.h b/sql/slave.h index 12d569b0333..646fa178f81 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -278,7 +278,6 @@ void slave_background_gtid_pos_create_request (rpl_slave_state::gtid_pos_table *table_entry); void slave_background_gtid_pending_delete_request(void); -extern bool volatile abort_loop; extern Master_info *active_mi; /* active_mi for multi-master */ extern Master_info *default_master_info; /* To replace active_mi */ extern Master_info_index *master_info_index; diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 68e6a5da098..71d0ca90f4f 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2375,22 +2375,6 @@ void wsrep_wait_appliers_close(THD *thd) */ } -void wsrep_kill_mysql(THD *thd) -{ - if (mysqld_server_started) - { - if (!abort_loop) - { - WSREP_INFO("starting shutdown"); - kill_mysql(thd); - } - } - else - { - unireg_abort(1); - } -} - void wsrep_last_committed_id(wsrep_gtid_t* gtid) { diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 8d1a58a0f7d..2fc17fd3ef4 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -195,7 +195,6 @@ extern int wsrep_wait_committing_connections_close(int wait_time); extern void wsrep_close_applier(THD *thd); extern void wsrep_wait_appliers_close(THD *thd); extern void wsrep_close_applier_threads(int count); -extern void wsrep_kill_mysql(THD *thd); /* new defines */