1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.6' into 10.7

This commit is contained in:
Oleksandr Byelkin
2023-01-31 09:33:58 +01:00
140 changed files with 4096 additions and 705 deletions

View File

@@ -993,13 +993,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);
}
}
@@ -1104,7 +1110,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(),
@@ -1126,7 +1136,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);
@@ -3174,7 +3188,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;
@@ -3184,7 +3200,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);
@@ -3218,13 +3234,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;