Skip to content

Commit

Permalink
MDEV-30465 : Galera test galera_sr.MDEV-27615 takes 5mins
Browse files Browse the repository at this point in the history
After d7d3ad6 we should use KILL_CONNECTION_HARD to interrupt
debug_sync waits. Test case uses debug_sync and then disconnects
connection from cluster.
  • Loading branch information
Jan Lindström committed Jan 25, 2023
1 parent 2ba6f3d commit 8bccba1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sql/wsrep_mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8bccba1

Please sign in to comment.