diff options
author | guilhem@gbichot2 <> | 2003-11-23 17:02:59 +0100 |
---|---|---|
committer | guilhem@gbichot2 <> | 2003-11-23 17:02:59 +0100 |
commit | 05e5a35bf2db80d8c880618ad9424a8a52b31f13 (patch) | |
tree | 83cd5e156dfb886c15c3d3d13b272fe43f7e430b /sql/repl_failsafe.cc | |
parent | 9b4050c40668834ba4d933fe724af76c39c0fba8 (diff) | |
download | mariadb-git-05e5a35bf2db80d8c880618ad9424a8a52b31f13.tar.gz |
Replication:
Now the I/O thread (in flush_master_info()) flushes the relay log to disk
after reading every event. Slower but provides additionnal safety in case
of brutal crash.
I had to make the flush optional (i.e. add a if(some_bool_argument) in the function)
because sometimes flush_master_info() is called when there is no usable
relay log (the relay log's IO_CACHE is not initialized so can't be flushed).
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r-- | sql/repl_failsafe.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 0d2da91e015..084f7386b7b 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -908,7 +908,12 @@ int load_master_data(THD* thd) // don't hit the magic number if (active_mi->master_log_pos < BIN_LOG_HEADER_SIZE) active_mi->master_log_pos = BIN_LOG_HEADER_SIZE; - flush_master_info(active_mi); + /* + Relay log's IO_CACHE may not be inited (even if we are sure that some + host was specified; there could have been a problem when replication + started, which led to relay log's IO_CACHE to not be inited. + */ + flush_master_info(active_mi, 0); } mysql_free_result(master_status_res); } |