diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_partition.cc | 8 | ||||
-rw-r--r-- | sql/ha_partition.h | 1 | ||||
-rw-r--r-- | sql/handler.cc | 36 | ||||
-rw-r--r-- | sql/log_event.cc | 7 | ||||
-rw-r--r-- | sql/mysqld.cc | 19 | ||||
-rw-r--r-- | sql/slave.cc | 15 | ||||
-rw-r--r-- | sql/sql_partition_admin.cc | 13 | ||||
-rw-r--r-- | sql/sql_truncate.cc | 12 | ||||
-rw-r--r-- | sql/sys_vars.cc | 4 | ||||
-rw-r--r-- | sql/wsrep_binlog.cc | 74 | ||||
-rw-r--r-- | sql/wsrep_binlog.h | 3 | ||||
-rw-r--r-- | sql/wsrep_check_opts.cc | 13 | ||||
-rw-r--r-- | sql/wsrep_hton.cc | 19 | ||||
-rw-r--r-- | sql/wsrep_mysqld.cc | 27 | ||||
-rw-r--r-- | sql/wsrep_mysqld.h | 10 | ||||
-rw-r--r-- | sql/wsrep_sst.cc | 3 |
16 files changed, 205 insertions, 59 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 603e0bf59dc..5875703491e 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -384,7 +384,13 @@ const char *ha_partition::table_type() const // we can do this since we only support a single engine type return m_file[0]->table_type(); } - +#ifdef WITH_WSREP +int ha_partition::wsrep_db_type() const +{ + // we can do this since we only support a single engine type + return ha_legacy_type(m_file[0]->ht); +} +#endif /* WITH_WSREP */ /* Destructor method diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 7407388b7b2..69dc080f147 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1264,6 +1264,7 @@ public: return h; } #ifdef WITH_WSREP + virtual int wsrep_db_type() const; void wsrep_reset_files() { for (uint i=0; i < m_tot_parts; i++) diff --git a/sql/handler.cc b/sql/handler.cc index 4c797259e2c..93c0e6f1a04 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1398,14 +1398,29 @@ int ha_commit_trans(THD *thd, bool all) if (WSREP(thd) && ht->db_type== DB_TYPE_WSREP) { error= 1; - /* avoid sending error, if we need to replay */ - if (thd->wsrep_conflict_state!= MUST_REPLAY) + switch (err) { - my_error(ER_LOCK_DEADLOCK, MYF(0), err); + case WSREP_TRX_SIZE_EXCEEDED: + /* give user size exeeded erro from wsrep_api.h */ + my_error(ER_ERROR_DURING_COMMIT, MYF(0), WSREP_SIZE_EXCEEDED); + break; + case WSREP_TRX_CERT_FAIL: + case WSREP_TRX_ERROR: + /* avoid sending error, if we need to replay */ + if (thd->wsrep_conflict_state!= MUST_REPLAY) + { + my_error(ER_LOCK_DEADLOCK, MYF(0), err); + } } } - else - /* not wsrep hton, bail to native mysql behavior */ + /* avoid sending error, if we need to replay */ + if (thd->wsrep_conflict_state!= MUST_REPLAY) + { + my_error(ER_LOCK_DEADLOCK, MYF(0), err); + } + } + lse + /* not wsrep hton, bail to native mysql behavior */ #endif /* WITH_WSREP */ my_error(ER_ERROR_DURING_COMMIT, MYF(0), err); #ifdef WITH_WSREP @@ -5754,6 +5769,17 @@ static int binlog_log_row(TABLE* table, bool error= 0; THD *const thd= table->in_use; +#ifdef WITH_WSREP + /* only InnoDB tables will be replicated through binlog emulation */ + if (WSREP_EMULATE_BINLOG(thd) && + table->file->ht->db_type != DB_TYPE_INNODB && + !(table->file->ht->db_type == DB_TYPE_PARTITION_DB && + (((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB))) + // !strcmp(table->file->table_type(), "InnoDB")) + { + return 0; + } +#endif /* WITH_WSREP */ if (check_table_binlog_row_based(thd, table)) { MY_BITMAP cols; diff --git a/sql/log_event.cc b/sql/log_event.cc index de53a26dd81..1524d86de58 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3087,7 +3087,12 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, { time_t end_time; #ifdef WITH_WSREP - thd->wsrep_PA_safe= false; + /* + If Query_log_event will contain non trans keyword (not BEGIN, COMMIT, + SAVEPOINT or ROLLBACK) we disable PA for this transaction. + */ + if (!is_trans_keyword()) + thd->wsrep_PA_safe= false; #endif /* WITH_WSREP */ memset(&user, 0, sizeof(user)); memset(&host, 0, sizeof(host)); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 39ec8c760bf..b2f0595fe94 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3416,10 +3416,21 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) should not be any other mysql_cond_signal() calls. */ mysql_mutex_lock(&LOCK_thread_count); - mysql_mutex_unlock(&LOCK_thread_count); mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); + + /* + Waiting for until mysqld_server_started != 0 + to ensure that all server components has been successfully + initialized. This step is mandatory since signal processing + could be done safely only when all server components + has been initialized. + */ + mysql_mutex_lock(&LOCK_server_started); + while (!mysqld_server_started) + mysql_cond_wait(&COND_server_started, &LOCK_server_started); + mysql_mutex_unlock(&LOCK_server_started); - (void) pthread_sigmask(SIG_BLOCK,&set,NULL); for (;;) { int error; // Used when debugging @@ -5295,7 +5306,7 @@ pthread_handler_t start_wsrep_THD(void *arg) mysql_mutex_lock(&LOCK_thread_count); wsrep_running_threads++; - mysql_cond_signal(&COND_thread_count); + mysql_cond_broadcast(&COND_thread_count); mysql_mutex_unlock(&LOCK_thread_count); processor(thd); @@ -5305,7 +5316,7 @@ pthread_handler_t start_wsrep_THD(void *arg) mysql_mutex_lock(&LOCK_thread_count); wsrep_running_threads--; WSREP_DEBUG("wsrep running threads now: %lu", wsrep_running_threads); - mysql_cond_signal(&COND_thread_count); + mysql_cond_broadcast(&COND_thread_count); mysql_mutex_unlock(&LOCK_thread_count); // Note: We can't call THD destructor without crashing diff --git a/sql/slave.cc b/sql/slave.cc index e29387a4b7f..0dcaec838da 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4613,6 +4613,21 @@ err_during_init: DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5);); mysql_mutex_unlock(&rli->run_lock); // tell the world we are done +#ifdef WITH_WSREP + /* if slave stopped due to node going non primary, we set global flag to + trigger automatic restart of slave when node joins back to cluster + */ + if (WSREP_ON && !wsrep_ready) + { + WSREP_INFO("Slave thread stopped because node dropped from cluster"); + if (wsrep_restart_slave) + { + WSREP_INFO("wsrep_restart_slave was set and therefore slave will be " + "automatically restarted when node joins back to cluster"); + wsrep_restart_slave_activated= TRUE; + } + } +#endif /* WITH_WSREP */ DBUG_LEAVE; // Must match DBUG_ENTER() my_thread_end(); #ifdef HAVE_OPENSSL diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index 29ca86fa274..cab73519826 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -768,6 +768,19 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd) if (check_one_table_access(thd, DROP_ACL, first_table)) DBUG_RETURN(TRUE); +#ifdef WITH_WSREP + TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); + + if ((!thd->is_current_stmt_binlog_format_row() || + !find_temporary_table(thd, first_table)) && + wsrep_to_isolation_begin( + thd, first_table->db, first_table->table_name, NULL) + ) + { + WSREP_WARN("ALTER TABLE isolation failure"); + DBUG_RETURN(TRUE); + } +#endif /* WITH_WSREP */ if (open_tables(thd, &first_table, &table_counter, 0)) DBUG_RETURN(true); diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 47d3e6df71f..fd2d20c1813 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -455,6 +455,12 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref) { bool hton_can_recreate; +#ifdef WITH_WSREP + if (WSREP(thd) && wsrep_to_isolation_begin(thd, + table_ref->db, + table_ref->table_name, NULL)) + DBUG_RETURN(TRUE); +#endif /* WITH_WSREP */ if (lock_table(thd, table_ref, &hton_can_recreate)) DBUG_RETURN(TRUE); @@ -531,12 +537,6 @@ bool Sql_cmd_truncate_table::execute(THD *thd) if (check_one_table_access(thd, DROP_ACL, first_table)) DBUG_RETURN(res); -#ifdef WITH_WSREP - if (WSREP(thd) && wsrep_to_isolation_begin(thd, - first_table->db, - first_table->table_name, NULL)) - DBUG_RETURN(TRUE); -#endif /* WITH_WSREP */ if (! (res= truncate_table(thd, first_table))) my_ok(thd); DBUG_RETURN(res); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 36e3791d9cf..42566f1705f 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -4517,6 +4517,10 @@ static Sys_var_mybool Sys_wsrep_load_data_splitting( "transaction after every 10K rows inserted", GLOBAL_VAR(wsrep_load_data_splitting), CMD_LINE(OPT_ARG), DEFAULT(TRUE)); + +static Sys_var_mybool Sys_wsrep_restart_slave( + "wsrep_restart_slave", "Should MySQL slave be restarted automatically, when node joins back to cluster", + GLOBAL_VAR(wsrep_restart_slave), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); #endif /* WITH_WSREP */ static bool fix_host_cache_size(sys_var *, THD *, enum_var_type) diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc index a913da8df17..8458a299130 100644 --- a/sql/wsrep_binlog.cc +++ b/sql/wsrep_binlog.cc @@ -55,8 +55,8 @@ int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len) wsrep_max_ws_size, total_length); goto error; } - uchar* tmp = (uchar *)my_realloc(*buf, total_length, - MYF(MY_ALLOW_ZERO_PTR)); + + uchar* tmp = (uchar *)my_realloc(*buf, total_length, MYF(0)); if (!tmp) { WSREP_ERROR("could not (re)allocate buffer: %zu + %u", @@ -72,7 +72,7 @@ int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len) if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) { - WSREP_ERROR("failed to initialize io-cache"); + WSREP_WARN("failed to initialize io-cache"); goto cleanup; } @@ -81,7 +81,7 @@ int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len) error: if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) { - WSREP_WARN("failed to initialize io-cache"); + WSREP_ERROR("failed to initialize io-cache"); } cleanup: my_free(*buf); @@ -166,19 +166,19 @@ static int wsrep_write_cache_once(wsrep_t* const wsrep, { WSREP_WARN("transaction size limit (%lu) exceeded: %zu", wsrep_max_ws_size, total_length); + err = WSREP_TRX_SIZE_EXCEEDED; goto cleanup; } if (total_length > allocated) { size_t const new_size(heap_size(total_length)); - uchar* tmp = (uchar *)my_realloc(heap_buf, new_size, - MYF(MY_ALLOW_ZERO_PTR)); + uchar* tmp = (uchar *)my_realloc(heap_buf, new_size, MYF(0)); if (!tmp) { WSREP_ERROR("could not (re)allocate buffer: %zu + %u", allocated, length); - err = WSREP_SIZE_EXCEEDED; + err = WSREP_TRX_SIZE_EXCEEDED; goto cleanup; } @@ -233,7 +233,7 @@ static int wsrep_write_cache_inc(wsrep_t* const wsrep, if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) { WSREP_ERROR("failed to initialize io-cache"); - return WSREP_TRX_ROLLBACK; + return WSREP_TRX_ERROR; } int err(WSREP_OK); @@ -254,7 +254,7 @@ static int wsrep_write_cache_inc(wsrep_t* const wsrep, { WSREP_WARN("transaction size limit (%lu) exceeded: %zu", wsrep_max_ws_size, total_length); - err = WSREP_SIZE_EXCEEDED; + err = WSREP_TRX_SIZE_EXCEEDED; goto cleanup; } @@ -349,3 +349,59 @@ int wsrep_binlog_savepoint_rollback(THD *thd, void *sv) int rcode = binlog_hton->savepoint_rollback(binlog_hton, thd, sv); return rcode; } + +void wsrep_dump_rbr_direct(THD* thd, IO_CACHE* cache) +{ + char filename[PATH_MAX]= {0}; + int len= snprintf(filename, PATH_MAX, "%s/GRA_%ld_%lld.log", + wsrep_data_home_dir, thd->thread_id, + (long long)wsrep_thd_trx_seqno(thd)); + size_t bytes_in_cache = 0; + // check path + if (len >= PATH_MAX) + { + WSREP_ERROR("RBR dump path too long: %d, skipping dump.", len); + return ; + } + // init cache + my_off_t const saved_pos(my_b_tell(cache)); + if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) + { + WSREP_ERROR("failed to initialize io-cache"); + return ; + } + // open file + FILE* of = fopen(filename, "wb"); + if (!of) + { + WSREP_ERROR("Failed to open file '%s': %d (%s)", + filename, errno, strerror(errno)); + goto cleanup; + } + // ready to write + bytes_in_cache= my_b_bytes_in_cache(cache); + if (unlikely(bytes_in_cache == 0)) bytes_in_cache = my_b_fill(cache); + if (likely(bytes_in_cache > 0)) do + { + if (my_fwrite(of, cache->read_pos, bytes_in_cache, + MYF(MY_WME | MY_NABP)) == (size_t) -1) + { + WSREP_ERROR("Failed to write file '%s'", filename); + goto cleanup; + } + cache->read_pos= cache->read_end; + } while ((cache->file >= 0) && (bytes_in_cache= my_b_fill(cache))); + if(cache->error == -1) + { + WSREP_ERROR("RBR inconsistent"); + goto cleanup; + } +cleanup: + // init back + if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) + { + WSREP_ERROR("failed to reinitialize io-cache"); + } + // close file + if (of) fclose(of); +} diff --git a/sql/wsrep_binlog.h b/sql/wsrep_binlog.h index 408cc9b425c..f2ff713cf67 100644 --- a/sql/wsrep_binlog.h +++ b/sql/wsrep_binlog.h @@ -50,4 +50,7 @@ int wsrep_binlog_close_connection(THD* thd); int wsrep_binlog_savepoint_set(THD *thd, void *sv); int wsrep_binlog_savepoint_rollback(THD *thd, void *sv); +/* Dump replication buffer to disk without intermediate buffer */ +void wsrep_dump_rbr_direct(THD* thd, IO_CACHE* cache); + #endif /* WSREP_BINLOG_H */ diff --git a/sql/wsrep_check_opts.cc b/sql/wsrep_check_opts.cc index ce8a46c6bd5..5ec18c79978 100644 --- a/sql/wsrep_check_opts.cc +++ b/sql/wsrep_check_opts.cc @@ -303,19 +303,6 @@ check_opts (int const argc, const char* const argv[], struct opt opts[]) } } - long long query_cache_size, query_cache_type; - if ((err = get_long_long (opts[QUERY_CACHE_SIZE], &query_cache_size, 10))) - return err; - if ((err = get_long_long (opts[QUERY_CACHE_TYPE], &query_cache_type, 10))) - return err; - - if (0 != query_cache_size && 0 != query_cache_type) - { - WSREP_ERROR ("Query cache is not supported (size=%lld type=%lld)", - query_cache_size, query_cache_type); - rcode = EINVAL; - } - bool locked_in_memory; err = get_bool (opts[LOCKED_IN_MEMORY], &locked_in_memory); if (err) { WSREP_ERROR("get_bool error: %s", strerror(err)); return err; } diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc index efb6ed87179..44f345ef3aa 100644 --- a/sql/wsrep_hton.cc +++ b/sql/wsrep_hton.cc @@ -134,7 +134,7 @@ wsrep_close_connection(handlerton* hton, THD* thd) - certification test or an equivalent. As a result, the current transaction just rolls back Error codes: - WSREP_TRX_ROLLBACK, WSREP_TRX_ERROR + WSREP_TRX_CERT_FAIL, WSREP_TRX_SIZE_EXCEEDED, WSREP_TRX_ERROR - a post-certification failure makes this server unable to commit its own WS and therefore the server must abort */ @@ -155,14 +155,7 @@ static int wsrep_prepare(handlerton *hton, THD *thd, bool all) !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && (thd->variables.wsrep_on && !wsrep_trans_cache_is_empty(thd))) { - switch (wsrep_run_wsrep_commit(thd, hton, all)) - { - case WSREP_TRX_OK: - break; - case WSREP_TRX_ROLLBACK: - case WSREP_TRX_ERROR: - DBUG_RETURN(1); - } + DBUG_RETURN (wsrep_run_wsrep_commit(thd, hton, all)); } DBUG_RETURN(0); } @@ -330,7 +323,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) WSREP_INFO("innobase_commit, abort %s", (thd->query()) ? thd->query() : "void"); } - DBUG_RETURN(WSREP_TRX_ROLLBACK); + DBUG_RETURN(WSREP_TRX_CERT_FAIL); } mysql_mutex_lock(&LOCK_wsrep_replaying); @@ -381,7 +374,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); WSREP_DEBUG("innobase_commit abort after replaying wait %s", (thd->query()) ? thd->query() : "void"); - DBUG_RETURN(WSREP_TRX_ROLLBACK); + DBUG_RETURN(WSREP_TRX_CERT_FAIL); } thd->wsrep_query_state = QUERY_COMMITTING; @@ -394,7 +387,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) rcode = wsrep_write_cache(wsrep, thd, cache, &data_len); if (WSREP_OK != rcode) { WSREP_ERROR("rbr write fail, data_len: %zu, %d", data_len, rcode); - DBUG_RETURN(WSREP_TRX_ROLLBACK); + DBUG_RETURN(WSREP_TRX_SIZE_EXCEEDED); } } @@ -517,7 +510,7 @@ wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) } mysql_mutex_unlock(&thd->LOCK_wsrep_thd); - DBUG_RETURN(WSREP_TRX_ROLLBACK); + DBUG_RETURN(WSREP_TRX_CERT_FAIL); case WSREP_CONN_FAIL: WSREP_ERROR("connection failure"); diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 38b34a061d4..35629b1fbf6 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -26,6 +26,7 @@ #include <cstdio> #include <cstdlib> #include "log_event.h" +#include <slave.h> wsrep_t *wsrep = NULL; my_bool wsrep_emulate_bin_log = FALSE; // activating parts of binlog interface @@ -63,7 +64,10 @@ ulong wsrep_mysql_replication_bundle = 0; my_bool wsrep_desync = 0; // desynchronize the node from the // cluster my_bool wsrep_load_data_splitting = 1; // commit load data every 10K intervals - +my_bool wsrep_restart_slave = 0; // should mysql slave thread be + // restarted, if node joins back +my_bool wsrep_restart_slave_activated = 0; // node has dropped, and slave + // restart will be needed /* * End configuration options */ @@ -126,7 +130,7 @@ static void wsrep_log_cb(wsrep_log_level_t level, const char *msg) { sql_print_error("WSREP: %s", msg); break; case WSREP_LOG_DEBUG: - if (wsrep_debug) sql_print_information ("[Debug] WSREP: %s", msg); + sql_print_information ("[Debug] WSREP: %s", msg); default: break; } @@ -427,6 +431,12 @@ static void wsrep_synced_cb(void* app_ctx) // and wait for SE initialization wsrep_SE_init_wait(); } + if (wsrep_restart_slave_activated) + { + WSREP_INFO("MySQL slave restart"); + wsrep_restart_slave_activated= FALSE; + init_slave(); + } } static void wsrep_init_position() @@ -507,7 +517,18 @@ int wsrep_init() wsrep_ready_set(TRUE); wsrep_inited= 1; global_system_variables.wsrep_on = 0; - return 0; + wsrep_init_args args; + args.options = (wsrep_provider_options) ? + wsrep_provider_options : ""; + rcode = wsrep->init(wsrep, &args); + if (rcode) + { + DBUG_PRINT("wsrep",("wsrep::init() failed: %d", rcode)); + WSREP_ERROR("wsrep::init() failed: %d, must shutdown", rcode); + free(wsrep); + wsrep = NULL; + } + return rcode; } else { diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 7cf4871d6f4..c8a7e0088e2 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -96,6 +96,8 @@ extern my_bool wsrep_replicate_myisam; extern my_bool wsrep_log_conflicts; extern ulong wsrep_mysql_replication_bundle; extern my_bool wsrep_load_data_splitting; +extern my_bool wsrep_restart_slave; +extern my_bool wsrep_restart_slave_activated; enum enum_wsrep_OSU_method { WSREP_OSU_TOI, WSREP_OSU_RSU }; @@ -232,8 +234,9 @@ extern void wsrep_ready_wait(); enum wsrep_trx_status { WSREP_TRX_OK, - WSREP_TRX_ROLLBACK, - WSREP_TRX_ERROR, + WSREP_TRX_CERT_FAIL, /* certification failure, must abort */ + WSREP_TRX_SIZE_EXCEEDED, /* trx size exceeded */ + WSREP_TRX_ERROR, /* native mysql error */ }; extern enum wsrep_trx_status @@ -274,6 +277,7 @@ extern rpl_sidno wsrep_sidno; #endif /* GTID_SUPPORT */ extern my_bool wsrep_preordered_opt; +#ifdef HAVE_PSI_INTERFACE extern PSI_mutex_key key_LOCK_wsrep_ready; extern PSI_mutex_key key_COND_wsrep_ready; extern PSI_mutex_key key_LOCK_wsrep_sst; @@ -288,7 +292,7 @@ extern PSI_mutex_key key_LOCK_wsrep_replaying; extern PSI_cond_key key_COND_wsrep_replaying; extern PSI_mutex_key key_LOCK_wsrep_slave_threads; extern PSI_mutex_key key_LOCK_wsrep_desync; - +#endif /* HAVE_PSI_INTERFACE */ struct TABLE_LIST; int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_, const TABLE_LIST* table_list); diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index f2ab8997079..23bdf12abe9 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -939,8 +939,9 @@ wait_signal: else { WSREP_ERROR("Failed to read from: %s", proc.cmd()); + proc.wait(); } - if (err && proc.error()) err= proc.error(); + if (!err && proc.error()) err= proc.error(); } else { |