diff options
Diffstat (limited to 'sql/service_wsrep.cc')
-rw-r--r-- | sql/service_wsrep.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc index 204d671d53b..b24f3cb511a 100644 --- a/sql/service_wsrep.cc +++ b/sql/service_wsrep.cc @@ -112,7 +112,17 @@ extern "C" my_bool wsrep_get_debug() extern "C" my_bool wsrep_thd_is_local(const THD *thd) { - return thd->wsrep_cs().mode() == wsrep::client_state::m_local; + /* + 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 + */ + return ( + thd->system_thread != SYSTEM_THREAD_SLAVE_BACKGROUND && + thd->system_thread != SYSTEM_THREAD_SLAVE_IO && + thd->wsrep_cs().mode() == wsrep::client_state::m_local); } extern "C" my_bool wsrep_thd_is_applying(const THD *thd) |