summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorguilhem@gbichot2 <>2003-11-23 17:02:59 +0100
committerguilhem@gbichot2 <>2003-11-23 17:02:59 +0100
commit05e5a35bf2db80d8c880618ad9424a8a52b31f13 (patch)
tree83cd5e156dfb886c15c3d3d13b272fe43f7e430b /sql/sql_repl.cc
parent9b4050c40668834ba4d933fe724af76c39c0fba8 (diff)
downloadmariadb-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.cc7
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;