From 8bccba1d4aa0442bb30a7962e6dd27144f90a0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 25 Jan 2023 10:01:00 +0200 Subject: [PATCH] MDEV-30465 : Galera test galera_sr.MDEV-27615 takes 5mins After d7d3ad69 we should use KILL_CONNECTION_HARD to interrupt debug_sync waits. Test case uses debug_sync and then disconnects connection from cluster. --- sql/wsrep_mysqld.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index f8ee05d665c..219bf9fc9c7 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2795,7 +2795,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)) { WSREP_DEBUG("Informing thread %lld that it's time to die", thd->thread_id); @@ -2807,7 +2809,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); @@ -2843,13 +2845,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;