diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-02-17 19:39:05 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-02-17 19:39:05 +0200 |
commit | 94b45787045677c106a25ebb5aaf1273040b2ff6 (patch) | |
tree | 4231461f1f43bc3dd1335c7f7738cd85d2957621 /sql/wsrep_mysqld.cc | |
parent | 66b8edf8a57c106b15ef1de2b25ce3e992540b71 (diff) | |
parent | 16388f393c63b3e2158db1efec8dd9625a0a295e (diff) | |
download | mariadb-git-94b45787045677c106a25ebb5aaf1273040b2ff6.tar.gz |
Merge 10.5 into 10.6
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r-- | sql/wsrep_mysqld.cc | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 53150bfa7e7..9353aa82540 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -32,6 +32,7 @@ #include "sp_head.h" #include "sql_show.h" #include "sp.h" +#include "handler.h" #include "wsrep_priv.h" #include "wsrep_thd.h" #include "wsrep_sst.h" @@ -947,13 +948,13 @@ void wsrep_init_startup (bool sst_first) if (!strcmp(wsrep_provider, WSREP_NONE)) return; /* Skip replication start if no cluster address */ - if (!wsrep_cluster_address || wsrep_cluster_address[0] == 0) return; + if (!wsrep_cluster_address_exists()) return; /* Read value of wsrep_new_cluster before wsrep_start_replication(), the value is reset to FALSE inside wsrep_start_replication. */ - if (!wsrep_start_replication()) unireg_abort(1); + if (!wsrep_start_replication(wsrep_cluster_address)) unireg_abort(1); wsrep_create_rollbacker(); wsrep_create_appliers(1); @@ -1114,7 +1115,7 @@ void wsrep_shutdown_replication() set_current_thd(nullptr); } -bool wsrep_start_replication() +bool wsrep_start_replication(const char *wsrep_cluster_address) { int rcode; WSREP_DEBUG("wsrep_start_replication"); @@ -1129,12 +1130,7 @@ bool wsrep_start_replication() return true; } - if (!wsrep_cluster_address || wsrep_cluster_address[0]== 0) - { - // if provider is non-trivial, but no address is specified, wait for address - WSREP_DEBUG("wsrep_start_replication exit due to empty address"); - return true; - } + DBUG_ASSERT(wsrep_cluster_address[0]); bool const bootstrap(TRUE == wsrep_new_cluster); @@ -2041,9 +2037,15 @@ bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table, return true; break; case SQLCOM_ALTER_TABLE: - if (create_info && - !wsrep_should_replicate_ddl(thd, create_info->db_type)) - return false; + if (create_info) + { + const handlerton *hton= create_info->db_type; + + if (!hton) + hton= ha_default_handlerton(thd); + if (!wsrep_should_replicate_ddl(thd, hton)) + return false; + } /* fallthrough */ default: if (table && !thd->find_temporary_table(db, table)) @@ -2643,18 +2645,7 @@ static void wsrep_close_thread(THD *thd) thd->set_killed(KILL_CONNECTION); MYSQL_CALLBACK(thread_scheduler, post_kill_notification, (thd)); mysql_mutex_lock(&thd->LOCK_thd_kill); - if (thd->mysys_var) - { - thd->mysys_var->abort=1; - mysql_mutex_lock(&thd->mysys_var->mutex); - if (thd->mysys_var->current_cond) - { - mysql_mutex_lock(thd->mysys_var->current_mutex); - mysql_cond_broadcast(thd->mysys_var->current_cond); - mysql_mutex_unlock(thd->mysys_var->current_mutex); - } - mysql_mutex_unlock(&thd->mysys_var->mutex); - } + thd->abort_current_cond_wait(true); mysql_mutex_unlock(&thd->LOCK_thd_kill); } |