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/sql_repl.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/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index c30409fd0cb..3c477afa300 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1085,8 +1085,11 @@ int change_master(THD* thd, MASTER_INFO* mi) strmake(mi->master_log_name, mi->rli.group_master_log_name, sizeof(mi->master_log_name)-1); } - - flush_master_info(mi); + /* + Relay log's IO_CACHE may not be inited, if rli->inited==0 (server was never + a slave before). + */ + flush_master_info(mi, 0); if (need_relay_log_purge) { relay_log_purge= 1; |