diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-09-26 20:49:51 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-09-28 16:37:06 +0200 |
commit | 57e0da50bbef8164635317785b67dd468a908327 (patch) | |
tree | 89d1ed179afce8b040c8f2dfcfe179042ff27b2e /sql/wsrep_sst.cc | |
parent | 7aba6f8f8853acd18d471793f8b72aa1412b8151 (diff) | |
parent | dcbd51cee628d8d8fec9ff5476a6afc855b007aa (diff) | |
download | mariadb-git-57e0da50bbef8164635317785b67dd468a908327.tar.gz |
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql/wsrep_sst.cc')
-rw-r--r-- | sql/wsrep_sst.cc | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index 0a1d95f30b8..e648a7f4c69 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -15,6 +15,7 @@ #include "mariadb.h" #include "wsrep_sst.h" +#include <inttypes.h> #include <mysqld.h> #include <m_ctype.h> #include <strfunc.h> @@ -36,8 +37,14 @@ static char wsrep_defaults_file[FN_REFLEN * 2 + 10 + 30 + sizeof(WSREP_SST_OPT_CONF_SUFFIX) + sizeof(WSREP_SST_OPT_CONF_EXTRA)] = {0}; +const char* wsrep_sst_method = WSREP_SST_DEFAULT; +const char* wsrep_sst_receive_address = WSREP_SST_ADDRESS_AUTO; +const char* wsrep_sst_donor = ""; +const char* wsrep_sst_auth = NULL; + // container for real auth string static const char* sst_auth_real = NULL; +my_bool wsrep_sst_donor_rejects_queries = FALSE; bool wsrep_sst_method_check (sys_var *self, THD* thd, set_var* var) { @@ -60,7 +67,6 @@ bool wsrep_sst_method_update (sys_var *self, THD* thd, enum_var_type type) static const char* data_home_dir = NULL; -extern "C" void wsrep_set_data_home_dir(const char *data_dir) { data_home_dir= (data_dir && *data_dir) ? data_dir : NULL; @@ -156,7 +162,7 @@ void wsrep_sst_auth_free() bool wsrep_sst_auth_update (sys_var *self, THD* thd, enum_var_type type) { - return sst_auth_real_set (wsrep_sst_auth); + return sst_auth_real_set (wsrep_sst_auth); } void wsrep_sst_auth_init () @@ -171,7 +177,7 @@ bool wsrep_sst_donor_check (sys_var *self, THD* thd, set_var* var) bool wsrep_sst_donor_update (sys_var *self, THD* thd, enum_var_type type) { - return 0; + return 0; } bool wsrep_before_SE() @@ -217,7 +223,7 @@ bool wsrep_sst_wait () if (!sst_complete) { total_wtime += difftime(end_time, start_time); - WSREP_DEBUG("Waiting for SST to complete. current seqno: %ld waited %f secs.", local_seqno, total_wtime); + WSREP_DEBUG("Waiting for SST to complete. current seqno: %" PRId64 " waited %f secs.", local_seqno, total_wtime); service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL, "WSREP state transfer ongoing, current seqno: %ld waited %f secs", local_seqno, total_wtime); } @@ -303,7 +309,7 @@ bool wsrep_sst_received (wsrep_t* const wsrep, } if (memcmp(&local_uuid, &uuid, sizeof(wsrep_uuid_t)) || - local_seqno < seqno) + local_seqno < seqno || seqno < 0) { do_update= true; } @@ -454,6 +460,22 @@ static int generate_binlog_opt_val(char** ret) return 0; } +static int generate_binlog_index_opt_val(char** ret) +{ + DBUG_ASSERT(ret); + *ret= NULL; + if (opt_binlog_index_name) { + *ret= strcmp(opt_binlog_index_name, "0") ? + my_strdup(opt_binlog_index_name, MYF(0)) : my_strdup("", MYF(0)); + } + else + { + *ret= my_strdup("", MYF(0)); + } + if (!*ret) return -ENOMEM; + return 0; +} + static void* sst_joiner_thread (void* a) { sst_thread_arg* arg= (sst_thread_arg*) a; @@ -641,7 +663,9 @@ static ssize_t sst_prepare_other (const char* method, } const char* binlog_opt= ""; + const char* binlog_index_opt= ""; char* binlog_opt_val= NULL; + char* binlog_index_opt_val= NULL; int ret; if ((ret= generate_binlog_opt_val(&binlog_opt_val))) @@ -650,7 +674,15 @@ static ssize_t sst_prepare_other (const char* method, ret); return ret; } + + if ((ret= generate_binlog_index_opt_val(&binlog_index_opt_val))) + { + WSREP_ERROR("sst_prepare_other(): generate_binlog_index_opt_val() failed %d", + ret); + } + if (strlen(binlog_opt_val)) binlog_opt= WSREP_SST_OPT_BINLOG; + if (strlen(binlog_index_opt_val)) binlog_index_opt= WSREP_SST_OPT_BINLOG_INDEX; make_wsrep_defaults_file(); @@ -661,11 +693,14 @@ static ssize_t sst_prepare_other (const char* method, WSREP_SST_OPT_DATA " '%s' " " %s " WSREP_SST_OPT_PARENT " '%d'" - " %s '%s' ", + " %s '%s'" + " %s '%s'", method, addr_in, mysql_real_data_home, wsrep_defaults_file, - (int)getpid(), binlog_opt, binlog_opt_val); + (int)getpid(), binlog_opt, binlog_opt_val, + binlog_index_opt, binlog_index_opt_val); my_free(binlog_opt_val); + my_free(binlog_index_opt_val); if (ret < 0 || ret >= cmd_len) { @@ -1431,7 +1466,7 @@ void wsrep_SE_init_wait() if (!SE_initialized) { total_wtime += difftime(end_time, start_time); - WSREP_DEBUG("Waiting for SST to complete. current seqno: %ld waited %f secs.", local_seqno, total_wtime); + WSREP_DEBUG("Waiting for SST to complete. current seqno: %" PRId64 " waited %f secs.", local_seqno, total_wtime); service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL, "WSREP state transfer ongoing, current seqno: %ld waited %f secs", local_seqno, total_wtime); } |