summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-11-26 14:05:15 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-11-26 14:05:15 +0200
commit1afed2077491329797dd577c5b1e6594e4a82f65 (patch)
treea6869ae2e32dc2a7db8e01e2a69f3e350da831ee /sql
parent06972b2fbc3d3ae77e8a7ca4558d2e9ee64eba6d (diff)
parent9669536c2355efb6f71babc9d2e615e9125c816b (diff)
downloadmariadb-git-1afed2077491329797dd577c5b1e6594e4a82f65.tar.gz
Merge 10.2 into 10.3
The test galera_sst_mariabackup_table_options was disabled, because the server refuses to start up due to wrong parameters.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_parse.cc3
-rw-r--r--sql/wsrep_mysqld.cc22
-rw-r--r--sql/wsrep_mysqld.h4
-rw-r--r--sql/wsrep_var.cc3
4 files changed, 25 insertions, 7 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index d6473d58821..544ae1e4f8c 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2384,7 +2384,8 @@ com_multi_end:
/* wsrep BF abort in query exec phase */
mysql_mutex_lock(&thd->LOCK_thd_data);
do_end_of_statement= thd->wsrep_conflict_state != REPLAYING &&
- thd->wsrep_conflict_state != RETRY_AUTOCOMMIT;
+ thd->wsrep_conflict_state != RETRY_AUTOCOMMIT &&
+ !thd->killed;
mysql_mutex_unlock(&thd->LOCK_thd_data);
}
else
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 89eac6b3d00..e60fa94ba2a 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -2262,7 +2262,7 @@ int wsrep_wait_committing_connections_close(int wait_time)
}
-void wsrep_close_client_connections(my_bool wait_to_end)
+void wsrep_close_client_connections(my_bool wait_to_end, THD *except_caller_thd)
{
/*
First signal all threads that it's time to die
@@ -2284,6 +2284,12 @@ void wsrep_close_client_connections(my_bool wait_to_end)
if (!is_client_connection(tmp))
continue;
+ if (tmp == except_caller_thd)
+ {
+ DBUG_ASSERT(is_client_connection(tmp));
+ continue;
+ }
+
if (is_replaying_connection(tmp))
{
tmp->set_killed(KILL_CONNECTION);
@@ -2295,7 +2301,16 @@ void wsrep_close_client_connections(my_bool wait_to_end)
continue;
WSREP_DEBUG("closing connection %lld", (longlong) tmp->thread_id);
- wsrep_close_thread(tmp);
+
+ /*
+ instead of wsrep_close_thread() we do now soft kill by THD::awake
+ */
+ mysql_mutex_lock(&tmp->LOCK_thd_data);
+
+ tmp->awake(KILL_CONNECTION);
+
+ mysql_mutex_unlock(&tmp->LOCK_thd_data);
+
}
mysql_mutex_unlock(&LOCK_thread_count);
@@ -2313,7 +2328,8 @@ void wsrep_close_client_connections(my_bool wait_to_end)
#ifndef __bsdi__ // Bug in BSDI kernel
if (is_client_connection(tmp) &&
!abort_replicated(tmp) &&
- !is_replaying_connection(tmp))
+ !is_replaying_connection(tmp) &&
+ tmp != except_caller_thd)
{
WSREP_INFO("killing local connection: %lld", (longlong) tmp->thread_id);
close_connection(tmp,0);
diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h
index 819a56b9f23..b434c248347 100644
--- a/sql/wsrep_mysqld.h
+++ b/sql/wsrep_mysqld.h
@@ -160,7 +160,6 @@ extern "C" query_id_t wsrep_thd_query_id(THD *thd);
extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd);
extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id);
-extern void wsrep_close_client_connections(my_bool wait_to_end);
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);
@@ -308,7 +307,8 @@ void thd_binlog_trx_reset(THD * thd);
typedef void (*wsrep_thd_processor_fun)(THD *);
pthread_handler_t start_wsrep_THD(void *arg);
int wsrep_wait_committing_connections_close(int wait_time);
-void wsrep_close_client_connections(my_bool wait_to_end);
+extern void wsrep_close_client_connections(my_bool wait_to_end,
+ THD *except_caller_thd = NULL);
void wsrep_close_applier(THD *thd);
void wsrep_close_applier_threads(int count);
void wsrep_wait_appliers_close(THD *thd);
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index f8a494416e2..1471ad91a96 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -428,7 +428,8 @@ bool wsrep_reject_queries_update(sys_var *self, THD* thd, enum_var_type type)
WSREP_INFO("Rejecting client queries due to manual setting");
break;
case WSREP_REJECT_ALL_KILL:
- wsrep_close_client_connections(FALSE);
+ /* close all client connections, but this one */
+ wsrep_close_client_connections(FALSE, thd);
WSREP_INFO("Rejecting client queries and killing connections due to manual setting");
break;
default: