diff options
author | unknown <sasha@mysql.sashanet.com> | 2002-01-24 22:49:47 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2002-01-24 22:49:47 -0700 |
commit | de172721edc0d619f12ea9769373fa0d7fcfbeb5 (patch) | |
tree | dbd006cf3d35d4daf9ae21af895de3a3261faf0b /sql/log.cc | |
parent | 1c2802931e0ac2c328d5a0caa8955e774048bbb3 (diff) | |
download | mariadb-git-de172721edc0d619f12ea9769373fa0d7fcfbeb5.tar.gz |
more predicatable slave behaviour with wait_for_slave_stop in mysqltest
fixed a couple of bugs with SEQ_READ_APPEND cache
rpl000016 still has non-deterministic result, but I am going to commit and
push since what I have is now better than what is in the main repository
client/mysqltest.c:
added wait_for_slave_to_stop
cleaned up TODO and comments
include/my_sys.h:
fixed race in flush_io_cache in SEQ_READ_APPEND cache
mysql-test/r/rpl000016.result:
updated result
mysql-test/t/rpl000016.test:
use wait_for_slave_to_stop to have deterministic slave behaviour for the test
mysys/mf_iocache.c:
fixed race in flush_io_cache()
fixed failure to unlock mutex in my_b_append()
sql/log.cc:
be compatible with 3.23 master
sql/log_event.cc:
3.23 master compat
sql/slave.cc:
3.23 master compat
sql/sql_class.h:
compat with 3.23 master
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc index ec7396bda3c..d3ad4564a73 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -703,12 +703,37 @@ void MYSQL_LOG::new_file(bool inside_mutex) } } +bool MYSQL_LOG::append(Log_event* ev) +{ + bool error = 0; + pthread_mutex_lock(&LOCK_log); + + DBUG_ASSERT(log_file.type == SEQ_READ_APPEND); + // Log_event::write() is smart enough to use my_b_write() or + // my_b_append() depending on the kind of cache we have + if (ev->write(&log_file)) + { + error=1; + goto err; + } + if ((uint)my_b_append_tell(&log_file) > max_binlog_size) + { + new_file(1); + } + signal_update(); +err: + pthread_mutex_unlock(&LOCK_log); + return error; +} + bool MYSQL_LOG::appendv(const char* buf, uint len,...) { bool error = 0; va_list(args); va_start(args,len); + DBUG_ASSERT(log_file.type == SEQ_READ_APPEND); + pthread_mutex_lock(&LOCK_log); do { |