diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-11-23 09:58:17 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-11-23 09:58:17 -0700 |
commit | 993d1a5e2ff1ed34914dc7c6cf7a88685773b642 (patch) | |
tree | 06e93f9a02a1d7347c9b25278e84b580fd0f67a8 | |
parent | 7ef7d93726929ec678a8b07bed1be7bb56ad4b10 (diff) | |
parent | d1f560ef7be0df8052b0b094453ab5e46a22c887 (diff) | |
download | mariadb-git-993d1a5e2ff1ed34914dc7c6cf7a88685773b642.tar.gz |
Merge work:/home/bk/mysql
into mysql.sashanet.com:/home/sasha/src/bk/mysql
-rw-r--r-- | sql/sql_repl.cc | 11 | ||||
-rw-r--r-- | sql/sql_repl.h | 7 |
2 files changed, 11 insertions, 7 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 7d4a7847eb1..1940ff360c2 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -602,16 +602,13 @@ int stop_slave(THD* thd, bool net_report ) if (slave_running) { abort_slave = 1; - thr_alarm_kill(slave_real_id); -#ifdef SIGNAL_WITH_VIO_CLOSE - slave_thd->close_active_vio(); -#endif + KICK_SLAVE; // do not abort the slave in the middle of a query, so we do not set // thd->killed for the slave thread thd->proc_info = "waiting for slave to die"; while(slave_running) { - /* there is a small change that slave thread might miss the first + /* there is a small chance that slave thread might miss the first alarm. To protect againts it, resend the signal until it reacts */ @@ -630,7 +627,7 @@ int stop_slave(THD* thd, bool net_report ) #endif pthread_cond_timedwait(&COND_slave_stopped, &LOCK_slave, &abstime); if (slave_running) - thr_alarm_kill(slave_real_id); + KICK_SLAVE; } } else @@ -716,7 +713,7 @@ int change_master(THD* thd) if((slave_was_running = slave_running)) { abort_slave = 1; - thr_alarm_kill(slave_real_id); + KICK_SLAVE; thd->proc_info = "waiting for slave to die"; while(slave_running) pthread_cond_wait(&COND_slave_stopped, &LOCK_slave); // wait until done diff --git a/sql/sql_repl.h b/sql/sql_repl.h index c6a79ec4650..aa07d859aec 100644 --- a/sql/sql_repl.h +++ b/sql/sql_repl.h @@ -14,6 +14,13 @@ extern int max_binlog_dump_events; extern bool opt_sporadic_binlog_dump_fail; #endif +#ifdef SIGNAL_WITH_VIO_CLOSE +#define KICK_SLAVE { slave_thd->close_active_vio(); \ + thr_alarm_kill(slave_real_id); } +#else +#define KICK_SLAVE thr_alarm_kill(slave_real_id); +#endif + File open_binlog(IO_CACHE *log, const char *log_file_name, const char **errmsg); |