summaryrefslogtreecommitdiff
path: root/sql/service_wsrep.cc
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2021-04-14 22:40:46 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-04-20 08:24:14 +0300
commiteb4123eefc8e0ee4751d3cd3cc49ebf256aa9486 (patch)
treec4e88945dcaa90c3384010b24c13926f300655fb /sql/service_wsrep.cc
parent57caff245cbdcbdfda6f022de7f354f05a790656 (diff)
downloadmariadb-git-eb4123eefc8e0ee4751d3cd3cc49ebf256aa9486.tar.gz
More fixes to variable wsrep_on
* Disallow setting wsrep_on = 1 if wsrep_provider is unset. Also, move wsrep_on_basic from sys_vars to wsrep suite: this test now requires to run with wsrep_provider set * Disallow setting @@session.wsrep_on = 1 when @@global.wsrep_on = 0 * Handle the case where a new connection turns @@global.wsrep_on from off to on. In this case we would miss a call to wsrep_open, causing unexpected states in wsrep::client_state (causing assertions). * Disable wsrep.MDEV-22443 because it is no longer possible to enable wsrep_on, if server is started with wsrep_provider='none' Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
Diffstat (limited to 'sql/service_wsrep.cc')
-rw-r--r--sql/service_wsrep.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc
index 80f164855b2..14f136ca480 100644
--- a/sql/service_wsrep.cc
+++ b/sql/service_wsrep.cc
@@ -120,15 +120,23 @@ extern "C" my_bool wsrep_get_debug()
return wsrep_debug;
}
+/*
+ Test if this connection is a true local (user) connection and not
+ a replication or wsrep applier thread.
+
+ Note that this is only usable for galera (as there are other kinds
+ of system threads, and only if WSREP_NNULL() is tested by the caller.
+ */
extern "C" my_bool wsrep_thd_is_local(const THD *thd)
{
/*
- async replication IO and background threads have nothing to replicate in the cluster,
- marking them as non-local here to prevent write set population and replication
+ async replication IO and background threads have nothing to
+ replicate in the cluster, marking them as non-local here to
+ prevent write set population and replication
- async replication SQL thread, applies client transactions from mariadb master
- and will be replicated into cluster
- */
+ async replication SQL thread, applies client transactions from
+ mariadb master and will be replicated into cluster
+ */
return (
thd->system_thread != SYSTEM_THREAD_SLAVE_BACKGROUND &&
thd->system_thread != SYSTEM_THREAD_SLAVE_IO &&