Bug #72571 Logging the semi-sync replication disconnect
Submitted: 8 May 2014 12:01
Reporter: Will Fong Email Updates:
Status: Open Impact on me:
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.6.17 OS:Any
Assigned to: CPU Architecture:Any
Tags: logging, replication, semi-sync

[8 May 2014 12:01] Will Fong
In a semi-sync replication environment, when the slave disconnects from the master, it doesn't get logged to the master's error log. When the slave reconnects to the master, the master logs the disconnect and reconnect with the same timestamp.

For example:
2014-05-08 07:50:30 22241 [Note] Stop semi-sync binlog_dump to slave (server_id: 3)
2014-05-08 07:50:31 22241 [Note] Start semi-sync binlog_dump to slave (server_id: 3), pos(mysqlbinlog.000004, 3826)

However. I shut down the slave a few minutes prior, upgraded it, and then restarted.

This makes debugging issues more complicated since we don't know when it really disconnected, and actually a bit misleading. 

How to repeat:
Set up master and slave replication environment with semi-sync enabled.

Stop slave;

Wait a while.

Start slave;

Check master's error log for the disconnect/reconnect timestamps.

Suggested fix:
Ideally, it would be great if the slave notified the master that it disconnected and the master logged it at that time.

But it would also work if the two log lines were rolled into one, so it wouldn't be confused when the master cuts off that slave because of a disconnect.