diff options
author | Jan Lindström <jplindst@mariadb.org> | 2014-08-25 09:13:15 +0300 |
---|---|---|
committer | Jan Lindström <jplindst@mariadb.org> | 2014-08-25 09:13:15 +0300 |
commit | 9b506d4bcb11c0df32993df27597afbedf1eb2ed (patch) | |
tree | 039fffef5dad001bd3aa9de5139264986b914aa6 /sql/wsrep_thd.cc | |
parent | de38fcfbb125802413e6bb7df041720f6a63a32f (diff) | |
download | mariadb-git-9b506d4bcb11c0df32993df27597afbedf1eb2ed.tar.gz |
MDEV-6602: rpl.rpl_mdev6020 fails sporadically with SIGABRT
Analysis: Problem is that we execute galera code when we are actually
executing asyncronoush replication.
Fix: Do not execute galera code if wsrep provider is not set.
Diffstat (limited to 'sql/wsrep_thd.cc')
-rw-r--r-- | sql/wsrep_thd.cc | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index b485daa2a9c..6fc91c9fa31 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -503,17 +503,35 @@ int wsrep_thd_conflict_state(void *thd_ptr, my_bool sync) return state; } +my_bool wsrep_thd_is_wsrep(void *thd_ptr) +{ + my_bool status = FALSE; + if (thd_ptr) + { + THD* thd = (THD*)thd_ptr; + + status = (WSREP(thd) && WSREP_PROVIDER_EXISTS); + } + return status; +} + my_bool wsrep_thd_is_BF(void *thd_ptr, my_bool sync) -{ +{ my_bool status = FALSE; - if (thd_ptr) + if (thd_ptr) { THD* thd = (THD*)thd_ptr; - if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd); - - status = ((thd->wsrep_exec_mode == REPL_RECV) || - (thd->wsrep_exec_mode == TOTAL_ORDER)); - if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); + // THD can be BF only if provider exists + if (wsrep_thd_is_wsrep(thd_ptr)) + { + if (sync) + mysql_mutex_lock(&thd->LOCK_wsrep_thd); + + status = ((thd->wsrep_exec_mode == REPL_RECV) || + (thd->wsrep_exec_mode == TOTAL_ORDER)); + if (sync) + mysql_mutex_unlock(&thd->LOCK_wsrep_thd); + } } return status; } |