diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2020-08-10 11:44:42 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2020-08-14 08:32:36 +0300 |
commit | a7a9f44f8c2f2d09a0e0af6a560ef84608d4bb7e (patch) | |
tree | 3786239b7818b5ba63cc40ed159a7a5d104ff55c /sql/mdl.cc | |
parent | 2f7b37b02154748b223e385a7d7787900ab37b5e (diff) | |
download | mariadb-git-a7a9f44f8c2f2d09a0e0af6a560ef84608d4bb7e.tar.gz |
MDEV-22543 : Galera SST donation fails, FLUSH TABLES WITH READ LOCK times outbb-10.4-MDEV-22543
During SST we need to let FTWRL to use normal timeout method
even when client is disconnected.
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r-- | sql/mdl.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc index 54128c2ee97..a369f9e9a95 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -24,6 +24,7 @@ #include <mysql/plugin.h> #include <mysql/service_thd_wait.h> #include <mysql/psi/mysql_stage.h> +#include "wsrep_sst.h" #ifdef HAVE_PSI_INTERFACE static PSI_mutex_key key_MDL_wait_LOCK_wait_status; @@ -2325,18 +2326,26 @@ 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(m_owner->get_thd())) + if (! thd_is_connected(thd)) { - /* - * 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; +#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; + } } mysql_prlock_wrlock(&lock->m_rwlock); |