diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2018-09-14 08:47:22 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2018-09-14 08:47:22 +0200 |
commit | 28f08d3753eb10a1393a63e6c581d43aad9f93b9 (patch) | |
tree | 86c9df8c3fb6d4ebd99d431697c84f06ef242989 /sql/wsrep_sst.cc | |
parent | 38665893087e20c3ad65d5b0e227a75185a4865e (diff) | |
parent | f1bcfbb4373e40dda2c18c137f76fc6ff32e1a45 (diff) | |
download | mariadb-git-28f08d3753eb10a1393a63e6c581d43aad9f93b9.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/wsrep_sst.cc')
-rw-r--r-- | sql/wsrep_sst.cc | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index 908c0c56685..3790c81d398 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -15,6 +15,7 @@ #include "wsrep_sst.h" +#include <inttypes.h> #include <mysqld.h> #include <m_ctype.h> #include <my_sys.h> @@ -37,8 +38,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) { @@ -61,7 +68,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; @@ -157,7 +163,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 () @@ -172,9 +178,11 @@ 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; } +static wsrep_uuid_t cluster_uuid = WSREP_UUID_UNDEFINED; + bool wsrep_before_SE() { return (wsrep_provider != NULL @@ -218,7 +226,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); } @@ -304,7 +312,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; } @@ -455,6 +463,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; @@ -642,7 +666,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))) @@ -651,7 +677,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(); @@ -662,11 +696,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) { @@ -1432,7 +1469,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); } |