By default, relay logs filenames have the form
,
where host_name-relay-bin.nnnnnnhost_name is the name of the
slave server host and nnnnnn is a
sequence number. Successive relay log files are created using
successive sequence numbers, beginning with
000001. The slave uses an index file to track
the relay log files currently in use. The default relay log
index filename is
.
host_name-relay-bin.index
By default, the slave server creates relay log files in its data
directory. The default filenames can be overridden with the
--relay-log and
--relay-log-index server options. See
Section 6.1.3, “Replication Options and Variables”.
Relay logs have the same format as binary logs and can be read
using mysqlbinlog. The SQL thread
automatically deletes each relay log file as soon as it has
executed all events in the file and no longer needs it. There is
no explicit mechanism for deleting relay logs because the SQL
thread takes care of doing so. However, FLUSH
LOGS rotates relay logs, which influences when the SQL
thread deletes them.
A slave server creates a new relay log file under the following conditions:
Each time the I/O thread starts.
When the logs are flushed; for example, with FLUSH
LOGS or mysqladmin flush-logs.
When the size of the current relay log file becomes too large. The meaning of “too large” is determined as follows:
If the value of max_relay_log_size is
greater than 0, that is the maximum relay log file size.
If the value of max_relay_log_size is
0, max_binlog_size determines the
maximum relay log file size.

User Comments
Add your own comment.