summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-06-05 17:02:00 +0200
committerunknown <guilhem@mysql.com>2003-06-05 17:02:00 +0200
commitbd414c301c1bbadecf385e1c10aa8a27cd76f61a (patch)
tree24432faf9692f68267e53ba54ed40085a94775f4 /sql/slave.cc
parenta3afb2bcbea96d4c5a326204151fb63cd0411aec (diff)
downloadmariadb-git-bd414c301c1bbadecf385e1c10aa8a27cd76f61a.tar.gz
Test for bug 578. And a comment in slave.cc.
sql/slave.cc: Comment to remember that size of relay logs on disk is not the total size of the relay log.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index c2762dbd6f4..bead4323b0c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1186,6 +1186,26 @@ int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname)
strmov(strcend(tmp,'.'),"-relay-bin");
opt_relay_logname=my_strdup(tmp,MYF(MY_WME));
}
+
+ /*
+ The relay log will now be opened, as a SEQ_READ_APPEND IO_CACHE. It is
+ notable that the last kilobytes of it (8 kB for example) may live in memory,
+ not on disk (depending on what the thread using it does). While this is
+ efficient, it has a side-effect one must know:
+ the size of the relay log on disk (displayed by 'ls -l' on Unix) can be a
+ few kilobytes less than one would expect by doing SHOW SLAVE STATUS; this
+ happens when only the IO thread is started (not the SQL thread). The
+ "missing" kilobytes are in memory, are preserved during 'STOP SLAVE; START
+ SLAVE IO_THREAD', and are flushed to disk when the slave's mysqld stops. So
+ this does not cause any bug. Example of how disk size grows by leaps:
+
+ Read_Master_Log_Pos: 7811 -rw-rw---- 1 guilhem qq 4 Jun 5 16:19 gbichot2-relay-bin.002
+ ...later...
+ Read_Master_Log_Pos: 9744 -rw-rw---- 1 guilhem qq 8192 Jun 5 16:27 gbichot2-relay-bin.002
+
+ See how 4 is less than 7811 and 8192 is less than 9744.
+ */
+
if (open_log(&rli->relay_log, glob_hostname, opt_relay_logname,
"-relay-bin", opt_relaylog_index_name,
LOG_BIN, 1 /* read_append cache */,