1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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
This commit is contained in:
unknown
2001-11-03 16:54:00 -07:00
parent 368c6c1f30
commit cd825a1993
6 changed files with 290 additions and 42 deletions

View File

@ -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