summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/mdl.cc27
-rw-r--r--sql/wsrep_sst.cc19
-rw-r--r--sql/wsrep_utils.cc4
-rw-r--r--sql/wsrep_utils.h2
4 files changed, 17 insertions, 35 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 240ef97b1c4..4772dc017f9 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -25,9 +25,6 @@
#include <mysql/plugin.h>
#include <mysql/service_thd_wait.h>
#include <mysql/psi/mysql_stage.h>
-#ifdef WITH_WSREP
-#include "wsrep_sst.h"
-#endif
#include <tpool.h>
#include <pfs_metadata_provider.h>
#include <mysql/psi/mysql_mdl.h>
@@ -2335,26 +2332,18 @@ MDL_context::acquire_lock(MDL_request *mdl_request, double lock_wait_timeout)
wait_status= m_wait.timed_wait(m_owner, &abs_shortwait, FALSE,
mdl_request->key.get_wait_state_name());
- THD* thd= m_owner->get_thd();
-
if (wait_status != MDL_wait::EMPTY)
break;
/* Check if the client is gone while we were waiting. */
- if (! thd_is_connected(thd))
+ if (! thd_is_connected(m_owner->get_thd()))
{
-#if defined(WITH_WSREP) && !defined(EMBEDDED_LIBRARY)
- // During SST client might not be connected
- if (!wsrep_is_sst_progress())
-#endif
- {
- /*
- * The client is disconnected. Don't wait forever:
- * assume it's the same as a wait timeout, this
- * ensures all error handling is correct.
- */
- wait_status= MDL_wait::TIMEOUT;
- break;
- }
+ /*
+ * The client is disconnected. Don't wait forever:
+ * assume it's the same as a wait timeout, this
+ * ensures all error handling is correct.
+ */
+ wait_status= MDL_wait::TIMEOUT;
+ break;
}
mysql_prlock_wrlock(&lock->m_rwlock);
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index 444fb98c4b9..d91270a563f 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -1,4 +1,4 @@
-/* Copyright 2008-2017 Codership Oy <http://www.codership.com>
+/* Copyright 2008-2020 Codership Oy <http://www.codership.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -308,7 +308,6 @@ bool wsrep_before_SE()
&& strcmp (wsrep_sst_method, WSREP_SST_MYSQLDUMP));
}
-static bool sst_in_progress = false;
// Signal end of SST
static void wsrep_sst_complete (THD* thd,
int const rcode)
@@ -1629,11 +1628,11 @@ static void* sst_donor_thread (void* a)
wsrep_uuid_t ret_uuid= WSREP_UUID_UNDEFINED;
// seqno of complete SST
wsrep_seqno_t ret_seqno= WSREP_SEQNO_UNDEFINED;
- // SST is now in progress
- sst_in_progress= true;
- wsp::thd thd(FALSE); // we turn off wsrep_on for this THD so that it can
- // operate with wsrep_ready == OFF
+ // We turn off wsrep_on for this THD so that it can
+ // operate with wsrep_ready == OFF
+ // We also set this SST thread THD as system thread
+ wsp::thd thd(FALSE, true);
wsp::process proc(arg->cmd, "r", arg->env);
@@ -1736,9 +1735,6 @@ wait_signal:
proc.wait();
wsrep_donor_monitor_end();
- sst_in_progress= false;
-
-
return NULL;
}
@@ -1891,8 +1887,3 @@ int wsrep_sst_donate(const std::string& msg,
return (ret >= 0 ? 0 : 1);
}
-
-bool wsrep_is_sst_progress()
-{
- return (sst_in_progress);
-}
diff --git a/sql/wsrep_utils.cc b/sql/wsrep_utils.cc
index 148def54aaf..a679304c40a 100644
--- a/sql/wsrep_utils.cc
+++ b/sql/wsrep_utils.cc
@@ -417,7 +417,7 @@ process::wait ()
return err_;
}
-thd::thd (my_bool won) : init(), ptr(new THD(0))
+thd::thd (my_bool won, bool system_thread) : init(), ptr(new THD(0))
{
if (ptr)
{
@@ -426,6 +426,8 @@ thd::thd (my_bool won) : init(), ptr(new THD(0))
wsrep_store_threadvars(ptr);
ptr->variables.option_bits&= ~OPTION_BIN_LOG; // disable binlog
ptr->variables.wsrep_on= won;
+ if (system_thread)
+ ptr->system_thread= SYSTEM_THREAD_GENERIC;
ptr->security_ctx->master_access= ALL_KNOWN_ACL;
lex_start(ptr);
}
diff --git a/sql/wsrep_utils.h b/sql/wsrep_utils.h
index 4b010816a40..974c623521e 100644
--- a/sql/wsrep_utils.h
+++ b/sql/wsrep_utils.h
@@ -303,7 +303,7 @@ class thd
public:
- thd(my_bool wsrep_on);
+ thd(my_bool wsrep_on, bool system_thread=false);
~thd();
THD* const ptr;
};