diff options
author | Seppo Jaakola <seppo.jaakola@codership.com> | 2012-06-12 10:55:11 +0300 |
---|---|---|
committer | Seppo Jaakola <seppo.jaakola@codership.com> | 2012-06-12 10:55:11 +0300 |
commit | 33ffe0dd29b6564e49dde8b1abda914da4b2f178 (patch) | |
tree | d4ed7e628eb0b8bdf7be707261de9d862655211a /sql/mysqld.cc | |
parent | 609388fcfd912c9c2cb03a92251469a25a781893 (diff) | |
download | mariadb-git-33ffe0dd29b6564e49dde8b1abda914da4b2f178.tar.gz |
References lp:1011983
Merged from codership-mysql/5.5 changes revisions 3743-3756
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ec6219b978f..a88e76972e4 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4857,6 +4857,17 @@ WSREP_WARN("applier has wsrep_exec_mode = %d", thd->wsrep_exec_mode); #endif /* REMOVE */ } +static inline bool is_replaying_connection(THD *thd) +{ + bool ret; + + mysql_mutex_lock(&thd->LOCK_wsrep_thd); + ret= (thd->wsrep_conflict_state == REPLAYING) ? true : false; + mysql_mutex_unlock(&thd->LOCK_wsrep_thd); + + return ret; +} + static bool have_client_connections() { THD *tmp; @@ -4932,6 +4943,12 @@ void wsrep_close_client_connections(my_bool wait_to_end) if (!is_client_connection(tmp)) continue; + if (is_replaying_connection(tmp)) + { + tmp->killed= KILL_CONNECTION; + continue; + } + /* replicated transactions must be skipped */ if (abort_replicated(tmp)) continue; @@ -4953,9 +4970,11 @@ void wsrep_close_client_connections(my_bool wait_to_end) while ((tmp=it2++)) { #ifndef __bsdi__ // Bug in BSDI kernel - if (is_client_connection(tmp) && !abort_replicated(tmp)) + if (is_client_connection(tmp) && + !abort_replicated(tmp) && + !is_replaying_connection(tmp)) { - WSREP_INFO("SST kill local trx: %ld",tmp->thread_id); + WSREP_INFO("killing local connection: %ld",tmp->thread_id); close_connection(tmp,0,0); } #endif |