summaryrefslogtreecommitdiff
path: root/sql/wsrep_client_service.cc
diff options
context:
space:
mode:
authorTeemu Ollakka <teemu.ollakka@galeracluster.com>2019-08-30 08:42:24 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2019-08-30 08:42:24 +0300
commit9487e0b259e7f410f5f93ae59851be60d6a5112c (patch)
treeb14b034f20d585f0073a9ff5b3e4107d0da4628f /sql/wsrep_client_service.cc
parentd22f8c459ff107018b6330959b8c454435f2827e (diff)
downloadmariadb-git-9487e0b259e7f410f5f93ae59851be60d6a5112c.tar.gz
MDEV-19826 10.4 seems to crash with "pool-of-threads" (#1370)
MariaDB 10.4 was crashing when thread-handling was set to pool-of-threads and wsrep was enabled. There were two apparent reasons for the crash: - Connection handling in threadpool_common.cc was missing calls to control wsrep client state. - Thread specific storage which contains thread variables (THR_KEY_mysys) was not handled appropriately by wsrep patch when pool-of-threads was configured. This patch addresses the above issues in the following way: - Wsrep client state open/close was moved in thd_prepare_connection() and end_connection() to have common handling for one-thread-per-connection and pool-of-threads. - Thread local storage handling in wsrep patch was reworked by introducing set of wsrep_xxx_threadvars() calls which replace calls to THD store_globals()/reset_globals() and deal with thread handling specifics internally. Wsrep-lib was updated to version which relaxes internal concurrency related sanity checks. Rollback code from wsrep_rollback_process() was extracted to separate calls for better readability. Post rollback thread was removed as it was completely unused.
Diffstat (limited to 'sql/wsrep_client_service.cc')
-rw-r--r--sql/wsrep_client_service.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/sql/wsrep_client_service.cc b/sql/wsrep_client_service.cc
index b182691c593..5f73f9f714f 100644
--- a/sql/wsrep_client_service.cc
+++ b/sql/wsrep_client_service.cc
@@ -30,9 +30,9 @@
#include "slave.h" /* opt_log_slave_updates */
#include "transaction.h" /* trans_commit()... */
#include "log.h" /* stmt_has_updated_trans_table() */
-//#include "debug_sync.h"
#include "mysql/service_debug_sync.h"
#include "mysql/psi/mysql_thread.h" /* mysql_mutex_assert_owner() */
+
namespace
{
@@ -57,16 +57,12 @@ Wsrep_client_service::Wsrep_client_service(THD* thd,
void Wsrep_client_service::store_globals()
{
- DBUG_ENTER("Wsrep_client_service::store_globals");
- m_thd->store_globals();
- DBUG_VOID_RETURN;
+ wsrep_store_threadvars(m_thd);
}
void Wsrep_client_service::reset_globals()
{
- DBUG_ENTER("Wsrep_client_service::reset_globals");
- m_thd->reset_globals();
- DBUG_VOID_RETURN;
+ wsrep_reset_threadvars(m_thd);
}
bool Wsrep_client_service::interrupted(