From 33a8afd8efeab69095741fc841bac6e026c87910 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Mar 2014 20:50:19 +0100 Subject: MDEV-5703: [PATCH] Slave disconnects and fails to reconnect on Error_code: 1159 Patch from Tomas Matejicek Add missing error code to is_networ_error(), to allow slave to automatically attempt reconnection also in this case. --- sql/slave.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 0d762199323..c3c50501f53 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1217,6 +1217,7 @@ bool is_network_error(uint errorno) errorno == ER_CON_COUNT_ERROR || errorno == ER_CONNECTION_KILLED || errorno == ER_NEW_ABORTING_CONNECTION || + errorno == ER_NET_READ_INTERRUPTED || errorno == ER_SERVER_SHUTDOWN) return TRUE; -- cgit v1.2.1 From dd13db6f4ae70f45038c1d000cb1439e17170d98 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Fri, 14 Mar 2014 16:29:23 +0200 Subject: MDEV-5829: STOP SLAVE resets global status variables Reason for the bug was an optimization for higher connect speed where we moved when global status was updated, but forgot to update states when slave thread dies. Fixed by adding thd->add_status_to_global() before deleting slave thread's thd. mysys/my_delete.c: Added missing newline sql/mysqld.cc: Use add_status_to_global() sql/slave.cc: Added missing add_status_to_global() sql/sql_class.cc: Use add_status_to_global() sql/sql_class.h: Simplify adding local status to global by adding add_status_to_global() --- sql/slave.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index c3c50501f53..702b6d38cbe 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3356,6 +3356,7 @@ err: } write_ignored_events_info_to_relay_log(thd, mi); thd_proc_info(thd, "Waiting for slave mutex on exit"); + thd->add_status_to_global(); mysql_mutex_lock(&mi->run_lock); err_during_init: @@ -3746,6 +3747,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ thd->catalog= 0; thd->reset_query(); thd->reset_db(NULL, 0); + thd->add_status_to_global(); thd_proc_info(thd, "Waiting for slave mutex on exit"); mysql_mutex_lock(&rli->run_lock); err_during_init: -- cgit v1.2.1