diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-11-03 16:54:00 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-11-03 16:54:00 -0700 |
commit | cd825a19936d26735db0c1b4b251bd78617d0c2b (patch) | |
tree | 8abf01e56458b77f0e836d8f72481d71cc846b68 /sql/sql_repl.cc | |
parent | 368c6c1f30f44d1d028022a06dbcb9754815ee92 (diff) | |
download | mariadb-git-cd825a19936d26735db0c1b4b251bd78617d0c2b.tar.gz |
more work on IO_CACHE
portability fixes for systems with broken syscalls that do not interrupt on
a signal
temporary commit - will not be pushed, need to sync up
include/my_sys.h:
work on READ_APPEND cache
mysys/Makefile.am:
change to test IO_CACHE
mysys/mf_iocache.c:
work on READ_APPEND cache
BitKeeper/etc/ignore:
Added mysys/#mf_iocache.c# mysys/test_io_cache to the ignore list
sql/mysqld.cc:
make shutdown work on broken systems
sql/sql_repl.cc:
make sure slave can be stopped on broken systems in all cases, clean-up
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index b5300813410..684c084ece3 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -38,6 +38,13 @@ bool opt_sporadic_binlog_dump_fail = 0; static int binlog_dump_count = 0; #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 + static Slave_log_event* find_slave_event(IO_CACHE* log, const char* log_file_name, char* errmsg); @@ -700,10 +707,7 @@ 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"; @@ -728,7 +732,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 @@ -818,7 +822,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 @@ -1470,7 +1474,7 @@ int load_master_data(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 |