Uday Uday - 5 months ago 29
MySQL Question

mysql: When exactly the statement "Start binlog_dump to slave_server" logged in to the master error log

Recently, I have observed the below statement in the master server's MySQL error log many number of times.

"started bin_log dump to slave server"


I would like to know all the possible cases of when exactly this will be logged in the error log.

How connection failure between master and slave will impact this to be logged into the error log.

I suspect personally when we hit "START SLAVE" on the slave server, But it is not as I tested this.

Thanks in advance.

Answer

Exact message is this: Start binlog_dump to slave_server

In the source code this string is saved in the logfile when this function is called: mysql_binlog_send

With a bit of research, I see that just before this function is called, changes the slave state to this: Requesting binlog dump and in the MySQL reference manual says that this state is set just when the slave connects with the master.

So, exactly, this message appears when the slave connects with the master.

So it seems that the slave loses connection with the master and then reconnects.