diff options
author | Sergei Golubchik <serg@mariadb.org> | 2023-02-15 16:30:53 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2023-02-15 16:30:53 +0100 |
commit | b45ed284a69cdbffac61bdcf74bf86fa7b7391a4 (patch) | |
tree | de26ce8e0a5aa40889e889d758e3a3a98b9f71a8 /sql/wsrep_mysqld.cc | |
parent | cc182aca9352fb7efde0deb0a83844e1d5f0c64c (diff) | |
parent | cafba8761af55ae16cc69c9b53a341340a845b36 (diff) | |
download | mariadb-git-bb-11.0-all-builders.tar.gz |
Merge branch '10.11' into 11.0bb-11.0-all-builders
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r-- | sql/wsrep_mysqld.cc | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 2746cf732ce..2af57259be8 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1019,13 +1019,19 @@ void wsrep_init_startup (bool sst_first) With mysqldump SST (!sst_first) wait until the server reaches joiner state and procedd to accepting connections. */ + int err= 0; if (sst_first) { - server_state.wait_until_state(Wsrep_server_state::s_initializing); + err= server_state.wait_until_state(Wsrep_server_state::s_initializing); } else { - server_state.wait_until_state(Wsrep_server_state::s_joiner); + err= server_state.wait_until_state(Wsrep_server_state::s_joiner); + } + if (err) + { + WSREP_ERROR("Wsrep startup was interrupted"); + unireg_abort(1); } } @@ -1132,7 +1138,11 @@ void wsrep_stop_replication(THD *thd) { WSREP_DEBUG("Disconnect provider"); Wsrep_server_state::instance().disconnect(); - Wsrep_server_state::instance().wait_until_state(Wsrep_server_state::s_disconnected); + if (Wsrep_server_state::instance().wait_until_state( + Wsrep_server_state::s_disconnected)) + { + WSREP_WARN("Wsrep interrupted while waiting for disconnected state"); + } } /* my connection, should not terminate with wsrep_close_client_connection(), @@ -1154,7 +1164,11 @@ void wsrep_shutdown_replication() { WSREP_DEBUG("Disconnect provider"); Wsrep_server_state::instance().disconnect(); - Wsrep_server_state::instance().wait_until_state(Wsrep_server_state::s_disconnected); + if (Wsrep_server_state::instance().wait_until_state( + Wsrep_server_state::s_disconnected)) + { + WSREP_WARN("Wsrep interrupted while waiting for disconnected state"); + } } wsrep_close_client_connections(TRUE); @@ -3231,7 +3245,9 @@ static my_bool have_client_connections(THD *thd, void*) { DBUG_PRINT("quit",("Informing thread %lld that it's time to die", (longlong) thd->thread_id)); - if (is_client_connection(thd) && thd->killed == KILL_CONNECTION) + if (is_client_connection(thd) && + (thd->killed == KILL_CONNECTION || + thd->killed == KILL_CONNECTION_HARD)) { (void)abort_replicated(thd); return 1; @@ -3241,7 +3257,7 @@ static my_bool have_client_connections(THD *thd, void*) static void wsrep_close_thread(THD *thd) { - thd->set_killed(KILL_CONNECTION); + thd->set_killed(KILL_CONNECTION_HARD); MYSQL_CALLBACK(thread_scheduler, post_kill_notification, (thd)); mysql_mutex_lock(&thd->LOCK_thd_kill); thd->abort_current_cond_wait(true); @@ -3275,13 +3291,13 @@ static my_bool kill_all_threads(THD *thd, THD *caller_thd) if (is_client_connection(thd) && thd != caller_thd) { if (is_replaying_connection(thd)) - thd->set_killed(KILL_CONNECTION); + thd->set_killed(KILL_CONNECTION_HARD); else if (!abort_replicated(thd)) { /* replicated transactions must be skipped */ WSREP_DEBUG("closing connection %lld", (longlong) thd->thread_id); /* instead of wsrep_close_thread() we do now soft kill by THD::awake */ - thd->awake(KILL_CONNECTION); + thd->awake(KILL_CONNECTION_HARD); } } return 0; |