On Mon, 25 Jan 2010 11:51:24 -0800, Jeremy Zawodny <Jeremy@Zawodny.com> wrote:
On Mon, Jan 25, 2010 at 11:47 AM, Alex Yurchenko < alexey.yurchenko@codership.com> wrote:
On Mon, 25 Jan 2010 10:47:23 -0800, Jeremy Zawodny <Jeremy@Zawodny.com> wrote:
If the connection between a slave and master is interrupted, the slave won't report itself as being "behind" until the slave's network timeout to the master expires and it reconnect (assuming it can).
Jeremy
Hi Jeremy,
Does it mean that you want to detect network outages using the heartbeat? If so, won't it be easier to just set master-slave connection timeout to the desirable value and let replication system to handle it? I'm asking this not from position of improving current replication in short term, but from position of whether a heartbeat function is needed in replication API?
Not at all.
My point is that you cannot (today) rely on MySQL slaves to "self report" in all situations. With a heatbeat that the master sends every N seconds and the slave expects to see every N seconds, it's possible to see latency in the replication stream regardless of the cause--even during weird network outages that the slave won't notice until the timeout is reached.
Does that make more sense?
Perhaps, but not for me really ;). Actually I still don't understand what exactly people mean by "heartbeat" here. According to http://dev.mysql.com/doc/refman/5.5/en/change-master-to.html it is simply a transport keepalive. It does not even measure latency. To me it is not a "feature" actually, it is a bugfix. I realize that you are looking for solution to the present day situation. What I'm trying to figure out is whether it should be a part of replication API. So let me ask it differently. Suppose you have a replication system that provides cluster membership service (members come and gone) and provides you with a latency measurement (averaged over a specified window). Would you still need an explicit heartbeat "feature"? Regards, Alex -- Alexey Yurchenko, Codership Oy, www.codership.com Skype: alexey.yurchenko, Phone: +358-400-516-011